![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
1K+ Views
Let us first create a table −mysql> create table DemoTable ( Money DECIMAL(7, 2) ); Query OK, 0 rows affected (0.58 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(100.67); Query OK, 1 row affected (0.16 sec) mysql> insert into DemoTable values(199.33); Query OK, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
138 Views
For this, you can use GROUP BY HAVING clause. Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, Value int ); Query OK, 0 rows affected (0.52 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
1K+ Views
For this, use JSON_OBJECTAGG(). Let us first create a table −mysql> create table DemoTable ( Id int, FirstName varchar(100), Age int ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(10, 'John', 23); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
124 Views
Let us first create a table −mysql> create table DemoTable ( Logouttime time ); Query OK, 0 rows affected (0.62 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('5:50:00'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('6:10:10'); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
446 Views
For this, you can use the aggregate function SUM(). Let us first create a table −mysql> create table DemoTable ( isMarried tinyint(1) ); Query OK, 0 rows affected (0.84 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(0); Query OK, 1 row affected (0.26 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
218 Views
Let’s say you have set dates in the VARCHAR format. Now if you want to update the format, then use the UPDATE command along with STR_TO_DATE(). The syntax is as follows −update yourTableName set yourColumnName=str_to_date(yourColumnName, '%m/%d/%Y');Let us first create a table −mysql> create table DemoTable ( DueDate varchar(100) ); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
267 Views
Let us first create a table −mysql> create table DemoTable ( isValidUser boolean ); Query OK, 0 rows affected (0.70 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(true); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values(false); Query OK, 1 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
548 Views
Let us first create a table −mysql> create table DemoTable ( FirstDate datetime, SecondDate datetime ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-01-21', '2018-01-21'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
928 Views
First, you need to prepare a query and then you need to execute the PREPARED statement to dynamically choose a column in MySQL.Let us first create a table −mysql> create table DemoTable ( EmployeeName varchar(100) ); Query OK, 0 rows affected (0.77 sec)Insert some records in the table using ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
AmitDiwan
251 Views
Let us first create a table −mysql> create table DemoTable ( AdmissionDate varchar(100) ); Query OK, 0 rows affected (1.06 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2018-01-21'); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values('2019-08-13'); Query OK, 1 ... Read More