![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
Kumar Varma has Published 110 Articles
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
331 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Value int -> ); Query OK, 0 rows affected (0.57 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(0x41); Query OK, 1 row affected (0.12 sec) mysql> insert ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
140 Views
For this, you can use subquery. Let us first create a table −mysql> create table DemoTable -> ( -> Value int -> ); Query OK, 0 rows affected (0.61 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values(20); Query OK, 1 row ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
827 Views
Let us first create a table −mysql> create table DemoTable -> ( -> FirstName varchar(100) -> ); Query OK, 0 rows affected (0.41 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Adam^^^'); Query OK, 1 row affected (0.14 sec) mysql> insert ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
393 Views
Let us first create a table −mysql> create table DemoTable -> ( -> Name varchar(100), -> DueDate datetime -> ); Query OK, 0 rows affected (0.54 sec)Insert some records in the table using insert command. Let’s say the current date is “2019-07-03” −mysql> insert into DemoTable ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
969 Views
Yes, you can use ORDER BY DESC with GROUP BY. Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> PostMessage varchar(100) -> ); Query OK, 0 rows affected (0.69 sec)Insert some records in the ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
1K+ Views
Let us first create a table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> Name varchar(100), -> Subject varchar(100), -> Score int -> ); Query OK, 0 rows affected (0.94 sec)Insert some records in the table using ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
43 Views
For this, use ORDER BY DESC with LIMIT 1. Let us first create table −mysql> create table DemoTable -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> UserName varchar(100), -> UserMessage text -> ); Query OK, 0 rows affected (1.17 sec)Insert some records ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
964 Views
Yes, we can do this by first using CAST(). Let us first create a table −mysql> create table DemoTable -> ( -> StudentId int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> StudentScore varchar(100) -> ); Query OK, 0 rows affected (0.66 sec)Insert some records in the table ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
725 Views
For this, you can use REGEXP. Let us first create a table −mysql> create table DemoTable -> ( -> ClientCode varchar(100) -> ); Query OK, 0 rows affected (0.56 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('Chris902'); Query OK, 1 row ... Read More
![Kumar Varma](https://www.tutorialspoint.com/assets/profiles/13883/profile/60_73481-1512711460.jpg)
Kumar Varma
2K+ Views
You can use format specifier. Following is the syntax −select str_to_date(yourColumnName, '%d/%m/%Y %h:%i %p') as anyAliasName from yourTableName;Let us first create a table −mysql> create table DemoTable -> ( -> DueDate varchar(100) -> ); Query OK, 0 rows affected (0.51 sec)Insert some records in the table using ... Read More