Rishi Rathor has Published 149 Articles

How to detect shake gesture using Swift?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 14:03:26

790 Views

To detect a shake gesture in iOS UIKit provides three different methods, let’s see them one by one.Method 1 − When the shake gesture begins.override func motionBegan(_ motion: UIEvent.EventSubtype, with event: UIEvent?) { // code you want to implement }Method 2 − When the shake gesture ends.override func motionEnded(_ motion: ... Read More

MySQL Sum Query with IF Condition using Stored Procedure

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 11:13:27

607 Views

The Sum() is an aggregate function in MySQL. You can use sum query with if condition. To understand the sum query with if condition, let us create a table.The query to create a table −mysql> create table SumWithIfCondition    −> (    −> ModeOfPayment varchar(100)    −> ,    −> ... Read More

MySQL Select Multiple VALUES?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 09:07:55

19K+ Views

To select multiple values, you can use where clause with OR and IN operator.The syntax is as follows −Case 1 − Using ORselect *from yourTablename where yourColumnName = value1 or yourColumnName = value2 or yourColumnName = value3, .........N;Case 2 − Using INselect *from yourTableName where yourColumnName IN(value1, value2, ....N);To understand ... Read More

How do you force MySQL LIKE to be case sensitive?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 08:53:21

781 Views

To force MySQL LIKE to be case sensitive with the help of LIKE BINARY, the following is the syntax −select yourColumnName like binary 'anyStringValue' from yourTableName;To understand the above concept, let us create a table. The following is the query to create a table −mysql> create table LikeBinaryDemo    −> ... Read More

Get date format DD/MM/YYYY with MySQL Select Query?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 07:31:48

2K+ Views

Use the STR_TO_DATE() function from MySQL to set a date format for displaying DD/MM/YYYY date. The syntax is as follows −SELECT STR_TO_DATE(yourColumnName, ’%d/%m/%Y) as anyVariableName from yourTableName.To understand the above syntax, let us create a table −mysql> create table DateFormatDemo    −> (       −> IssueDate varchar(100)   ... Read More

How to cast DATETIME as a DATE in MySQL?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 07:27:03

424 Views

To cast DATETIME as a DATE in MySQL, use the CAST() function. The syntax is as follows −select cast(yourColumnName as Date) as anyVariableName from yourTableName;To understand the above syntax, let us first create a table −mysql> create table ConvertDatetimeToDate −> (    −> YourDatetime datetime −> ); Query OK, 0 ... Read More

Delete all records from a table in MySQL?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 07:20:56

14K+ Views

To delete all the records from a table in MySQL, use the TRUNCATE command. Let us fir see the syntax −TRUNCATE TABLE yourTableName.The above syntax will delete all the records from a table. Let us create a table to understand the above syntax −mysql> create table TruncateTableDemo −> (   ... Read More

How to get MySQL random integer range?

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 07:15:17

385 Views

To get the random integer range, use the rand() function. The query to create a table −mysql> create table RandomIntegerDemo −> (    −> Number int −> ); Query OK, 0 rows affected (0.61 sec)Inserting records into table. The query is as follows −mysql> insert into RandomIntegerDemo values(1), (2), (3), ... Read More

Which element is used to insert some content after an element with CSS

Rishi Rathor

Rishi Rathor

Updated on 29-Jun-2020 07:13:02

264 Views

Use the :after element to add some content after an element. ExampleYou can try to run the following code to insert some content after an element with CSS −Live Demo                    p:after          {           ... Read More

Python Standard operators as functions

Rishi Rathor

Rishi Rathor

Updated on 27-Jun-2020 15:01:34

291 Views

In programming, operator is generally a symbol (key) predefined to perform a certain operation such as addition, subtraction, comparison etc. Python has a large set of built-in operations divided in different categories such as arithmetic, comparison, bit-wise, membership etc.The operator module in python library consists of functions corresponding to built-in ... Read More

Advertisements