Mysql - ORDER BY - Can to use condition? -


i sort list date_modified desc

this problem when new record input, date_modified null date 0000-00-00 00:00:00

so record in bottom, not top of list.

how sort ? :(

note: don't insert date_modified date , because have field date_create

order coalesce(date_modified, date_created) desc;

but, performance better if set date_modified current_timestamp when doing insert, suggested.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -