Wednesday, January 11, 2012

PHP MYSQL before date descending order and after date ascending orderr

PHP MYSQL before date descending order and after date ascending order
(
SELECT *
FROM `usersexample`
WHERE date_col<=current_date
ORDER BY
date_col DESC
)
UNION (


SELECT *
FROM `usersexample`
WHERE date_col >=current_date
ORDER BY date_col ASC
)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.