![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 11367 Articles
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
84 Views
At first, to use reserved words, it should be set with backticks like −`from` `to`Since you want to select the column names set with backtick as shown above, you need to implement the following −select `to`, `from` from yourTableName;Let us first create a table with column names as from and ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
543 Views
The slash means division ( /) in MySQL query. This can be used to divide two numbers. Here, we will see an example to divide numbers from two columns and display result in a new column.Let us first create a table −mysql> create table DemoTable719 ( FirstNumber int, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
1K+ Views
For this, you can use NOT IN() function.Let us first create a table −mysql> create table DemoTable718 ( Id int, FirstName varchar(100), Age int ); Query OK, 0 rows affected (0.59 sec)Insert some records in the table using insert command −mysql> insert into DemoTable718 values(101, 'Chris', 26); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
80 Views
For this, you can use ORDER BY IF(CAST()). Let us first create a table −mysql> create table DemoTable(EmployeeCode varchar(100)); Query OK, 0 rows affected (1.17 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('190'); Query OK, 1 row affected (0.14 sec) mysql> insert into DemoTable ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
698 Views
Let us first create a table −mysql> create table DemoTable717 ( UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY, UserPassword int ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command −mysql> insert into DemoTable717(UserPassword) values(1454343); Query OK, 1 row affected (0.21 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
357 Views
Let us first create a table −mysql> create table DemoTable716 ( Id varchar(100), 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 DemoTable716 values('100', 45, 86, 79); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
571 Views
To order by length of column in MySQL, use ORDER BY LENGTH.Let us first create a table −mysql> create table DemoTable715 (UserMessage varchar(100)); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable715 values('Aw'); Query OK, 1 row affected (0.49 sec) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
841 Views
Let us first create a table −mysql> create table DemoTable1 (FirstName varchar(100)); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command −mysql> insert into DemoTable1 values('Bob'); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable1 values('James'); Query OK, 1 row affected (0.14 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
1K+ Views
To compare date strings, use STR_TO_DATE() from MySQL.Let us first create a table −mysql> create table DemoTable712 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ArrivalDate varchar(100) ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert into DemoTable712(ArrivalDate) values('10.01.2019'); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
103 Views
For this, use INTERVAL 8 MONTH and fetch records 8 months from the current date −select *from yourTableName where yourColumnName>= (CURRENT_DATE() - INTERVAL 8 MONTH);Note − Let’s say the current date is: 2018-02-06Let us first create a table −mysql> create table DemoTable (StudentName varchar(100), AdmissionDate date); Query OK, 0 rows ... Read More