Menus

Tuesday, 22 November 2016

MySQL Tutorials



mysql “Where not in” using two columns


Use this

SELECT *
FROM CompletedTasks
WHERE (userID, taskID) NOT IN
      ( SELECT userID, taskID
        FROM PlannedTasks
      ) ;


MySQL date format  in SELECT * query


Use DATE_FORMAT:
SELECT *, DATE_FORMAT(date, "%m-%d-%y") AS date FROM my_table;

DATE_FORMAT(created_date,'%d-%m-%y') AS created_date







No comments:

Post a Comment