- 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
642 Views
To exclude records, use MySQL NOT IN(). Let us first create a table −mysql> create table DemoTable ( Id int ); Query OK, 0 rows affected (0.64 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(1); Query OK, 1 row affected (0.16 sec) mysql> ... Read More
AmitDiwan
124 Views
Let us first create a table −mysql> create table DemoTable ( Name varchar(40), Position int ); Query OK, 0 rows affected (1.17 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris', 90); Query OK, 1 row affected (0.20 sec) mysql> insert into DemoTable ... Read More
AmitDiwan
86 Views
For this, use aggregate function COUNT() and GROUP BY to group those specific records for occurrences. Let us first create a table −mysql> create table DemoTable ( StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentSubject varchar(40) ); Query OK, 0 rows affected (5.03 sec)Insert some records in the ... Read More
AmitDiwan
332 Views
To find a match from records, use MySQL IN(). Let us first create a table −mysql> create table DemoTable ( Id int, FirstName varchar(20), Gender ENUM('Male', 'Female') ); Query OK, 0 rows affected (1.73 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More
AmitDiwan
311 Views
For this, use REGEXP. For example, characters J, A, V and A. Let us first create a table −mysql> create table DemoTable ( Value varchar(50) ); Query OK, 0 rows affected (3.92 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('XYSJGHAKLMVDFFSA'); Query OK, 1 ... Read More
AmitDiwan
899 Views
For this, you can use COUNT() along with CASE STATEMENT. Let us first create a table −mysql> create table DemoTable ( Score int ); Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(40); Query OK, 1 row affected ... Read More
AmitDiwan
157 Views
For this, use STR_TO_DATE(). Let us first create a table −mysql> create table DemoTable ( DueDate varchar(60) ) ; Query OK, 0 rows affected (0.71 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('12-AUG-2016'); Query OK, 1 row affected (0.11 sec) mysql> insert into ... Read More
AmitDiwan
220 Views
For this, you can use GROUP_CONCAT() along with GROUP BY clause. Both are used to group concat duplicates and display in a single line. Let us first create a table −mysql> create table DemoTable ( StudentFavouriteSubject varchar(40), StudentName varchar(40) ) ; Query OK, 0 rows affected (0.75 sec)Insert ... Read More
AmitDiwan
216 Views
Yes, you can search for particular numbers using the MySQL FIND_IN_SET(). Let us first create a table −mysql> create table DemoTable ( ListOfNumbers varchar(100) ); Query OK, 0 rows affected (1.24 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('784, 746, 894, 344'); Query ... Read More
AmitDiwan
82 Views
For this, use GROUP_CONCAT(). For only 1 values, work with MySQL WHERE clause. Let us first create a table −mysql> create table DemoTable ( PlayerName varchar(40), PlayerStatus tinyint(1) ); Query OK, 0 rows affected (0.60 sec)Insert some records in the table using insert command −mysql> insert into DemoTable ... Read More