Rishi Rathor has Published 142 Articles

MySQL Sum Query with IF Condition using Stored Procedure

Rishi Rathor

Rishi Rathor

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

795 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

22K+ 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

964 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

529 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

15K+ 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

515 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

334 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

Declare static variables and methods in an abstract class in Java

Rishi Rathor

Rishi Rathor

Updated on 27-Jun-2020 12:51:19

6K+ Views

If a method is declared as static, it is a member of a class rather than belonging to the object of the class. It can be called without creating an object of the class. A static method also has the power to access static data members of the class.A static ... Read More

Error Correcting Codes - Reed-Solomon codes

Rishi Rathor

Rishi Rathor

Updated on 27-Jun-2020 12:43:09

7K+ Views

Errors and Error Correcting CodesErrors in data occur when bits get corrupted in the data. When bits are transmitted over the computer network, they are subject to get corrupted due to interference and network problems, leading to errors.Error-correcting codes (ECC) are a sequence of numbers generated by specific algorithms for ... Read More

Advertisements