MysqlPhp

Important Mysql date, concat queries

Important Mysql date, concat queries

Views

Hello to all, welcome to therichpost.com. In this post, I will tell you Important Mysql date, concat queries. MySQL is an open source relational database management system.

Here are the some Important Mysql date, concat queries:

1. Mysql concat two columns in single column:

SELECT id, CONCAT(firstName, ‘-‘, phone) AS FIRSTNAME FROM `users` ORDER BY FIRSTNAME ASC

2. Mysql data with current date:

SELECT * FROM users WHERE startDateTime = CURDATE()

3. Mysql data with last week:

SELECT * FROM users WHERE startDateTime BETWEEN DATE_SUB(CURDATE(),INTERVAL 1 WEEk) AND CURDATE()

4. Mysql data with last Month:

SELECT * FROM user WHERE startDateTime BETWEEN DATE_SUB(CURDATE(),INTERVAL 1 MONTH) AND CURDATE()

5. Mysql data with Future data:

SELECT * FROM user startDateTime > CURDATE()

There are so many queries in Mysql and I will let you know all. Please do comment if you any query related to this post. Thank you. Therichpost.com

Ajay Malhotra
the authorAjay Malhotra
Hello to all. Welcome to therichpost.com. Myself Ajay Malhotra and I am full stack developer. I love coding. I know Wordpress, Core php, Angularjs, Angular 2, Angular 6, Angular 7, laravel, Codeigniter, Shopify, Squarespace, Jquery, Google Map Api, Vuejs, Reactjs, Bigcommerce etc.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Positive SSL