![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
409 Views
Use ORDER BY to sort data for duplicate record.Let us first create a table −mysql> create table DemoTable788 ( FirstName varchar(100), Score int ); Query OK, 0 rows affected (1.89 sec)Insert some records in the table using insert command −mysql> insert into DemoTable788 values('Chris', ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
2K+ Views
Let us first create a table −mysql> create table DemoTable787 ( Score1 int, Score2 int, Name varchar(100) ); Query OK, 0 rows affected (0.84 sec)Insert some records in the table using insert command −mysql> insert into DemoTable787 values(34, 56, 'Chris'); Query ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
504 Views
To display column values as CSV, use GROUP_CONCAT().Let us first create a table −mysql> create table DemoTable786 ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(100) ) AUTO_INCREMENT=101; Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
122 Views
For specific day of week, use DAYOFWEEK().Let us first create a table −mysql> create table DemoTable785 ( CustomerId int NOT NULL AUTO_INCREMENT PRIMARY KEY, CustomerName varchar(100), ShoppingDate date ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
143 Views
To ignore quotes while ordering column values, use ORDER BY TRIM().Let us first create a table −mysql> create table DemoTable784 ( Message varchar(100) ); Query OK, 0 rows affected (0.50 sec)Insert some records in the table using insert command −mysql> insert into DemoTable784 values('Good'); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
131 Views
Let us first create a table −mysql> create table DemoTable783 ( FirstName varchar(100) ); Query OK, 0 rows affected (0.65 sec)Insert some records in the table using insert command −mysql> insert into DemoTable783 values('Adam'); Query OK, 1 row affected (0.17 sec) mysql> insert into DemoTable783 values('Chris'); Query ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
423 Views
For this, use GROUP BY HAVING clause.Let us first create a table −mysql> create table DemoTable782 ( Name varchar(100), Score int ); Query OK, 0 rows affected (1.18 sec)Insert some records in the table using insert command −mysql> insert into DemoTable782 values('John', 156); Query ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
979 Views
Let us first create a table −mysql> create table DemoTable781 ( Name varchar(100) ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table using insert command −mysql> insert into DemoTable781 values(''); Query OK, 1 row affected (0.29 sec) mysql> insert into DemoTable781 values('Chris'); Query ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
315 Views
To exclude some of the column names, use NOT IN.Let us first create a table −mysql> create table DemoTable780 ( CustomerId int, CustomerName varchar(100), CustomerAge int, CustomerCountryName varchar(100), isMarried tinyint(1) ); Query OK, 0 rows affected (0.47 sec)Here is the query ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
133 Views
Since the column value ‘ADD’ is already a reserved word, therefore you need to use backticks around the word ADD like `ADD`.Let us see an example and create a table −mysql> create table DemoTable779 ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, `ADD` int ... Read More