mysql - Selecting and ordering by two fields -



mysql - Selecting and ordering by two fields -

i have query:

"select * bookmarks id=? order title asc",

which works great. i've added in field tag need order both tag , title.

application wise having bookmarks grouped tags (which alphabetical), , in each tag alphabetized individually.

i'm working on code to need sql give me info in order.

if had guess:

"select * bookmarks id=? order title asc , order tag asc",

thanks

you separate ordering columns comma (check select clause documentation):

select * bookmarks id=? order tag, title;

asc not needed - it's default sort order.

mysql

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -