I have this query:
"SELECT * FROM bookmarks WHERE id=? ORDER BY title ASC",
which works great. However I’ve added in another field tag I now need to order by both tag and title.
Application wise this would be like having all your bookmarks grouped into tags (which are alphabetical), and finally with in each tag alphabetized individually.
I’m working on the code to to do this I just need the sql to give me the data in order.
If I had to guess:
"SELECT * FROM bookmarks WHERE id=? ORDER BY title ASC AND ORDER BY tag ASC",
Thanks
You separate ordering columns with comma (check select clause documentation):
ASCis not needed – it’s the default sort order.