oracle multi-field sorting

Add field names and sorting rules (asc, desc) after order by, and the fields in the front have higher priority.

The following sql, find news in chronological order, and focus news is in the front:

select to_char(t.createtime,'YYYY-MM-DDHH24:MI:SS'),t.title,t.focusnews from chz_sg_news t 
order by t.focusnews desc,t.createtime asc

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325492759&siteId=291194637