![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
AmitDiwan has Published 11365 Articles
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
209 Views
For this, use the CASE WHEN statement. Let us first create a table −mysql> create table DemoTable1040 ( Value1 int, Value2 int, Value3 int ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1040 values(10, 30, 1); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
254 Views
To get the left substring, use LEFT() along with substring_index(). For example, let’s say the file path is −“/MyFile/JavaProgram/Hello.java “Here, we will see how to display the entire file path except for the file name i.e. −/MyFile/JavaProgram/Let us first create a table −mysql> create table DemoTable ( FileLocation text ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
218 Views
To get the fourth-highest value, use LIMIT OFFSET along with ORDER BY. Let us first create a table −mysql> create table DemoTable ( Amount int ); Query OK, 0 rows affected (0.88 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(980); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
349 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, FirstName varchar(100), LastName varchar(100) ); Query OK, 0 rows affected (1.00 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(FirstName, LastName) values('David', 'Miller'); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
3K+ Views
To suppress warnings, set SQL_NOTES=0. Let us see an example.At first, we will set SQL_NOTES to 1 −mysql> SET sql_notes = 1; Query OK, 0 rows affected (0.00 sec)Now, let us drop a table which does not exist. As you can see a warning message is now visible −mysql> drop ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
126 Views
For custom order, use ORDER BY FIELD(). Let us first create a table −mysql> create table DemoTable ( Title varchar(100) ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Java_1+'); Query OK, 1 row affected (0.14 sec) mysql> ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
78 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Name varchar(100), Score int ); Query OK, 0 rows affected (1.10 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(Name, Score) values('John', 45); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
550 Views
For this, you can use the INTERVAL 7 day concept. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, AdmissionDate datetime ); Query OK, 0 rows affected (0.83 sec)Note − Let’s say the current date is 2019-08-23.Insert some records ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
86 Views
Let us first create a table −mysql> create table DemoTable ( value1 int, value2 int, value3 int ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(20, 40, null); Query OK, 1 row affected (0.23 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
96 Views
For this, use ORDER BY with a modulus operator. Let us first create a table −mysql> create table DemoTable ( StudentId int, StudentName varchar(100) ); Query OK, 0 rows affected (1.88 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100, 'Chris'); Query OK, ... Read More