minnes
May 12th, 2003, 05:19 PM
Im thinking of a sql query statement where the result set is sorted by 2 columns at the same time is this possible?
For example if I have a list of items with titles and numbers, but it is the combination that is a unique key
would this work for example
SELECT * FROM TABLE ORDER BY TITLE, NUMBER
this is how I want the data
for example
APPLE 1
APPLE 2
BANNA 1
BANANA 2
any of you geniuses have any suggestions, if this would work in Mysql
or should I have separate tables for the Title list and item entries. My other idea is to select all the titles from a title table , then as I go down the title table , select all the entries in the item table and list them by number, this would work but needs an extra table and a couple extra lines of code, and we wouldnt want that.
For example if I have a list of items with titles and numbers, but it is the combination that is a unique key
would this work for example
SELECT * FROM TABLE ORDER BY TITLE, NUMBER
this is how I want the data
for example
APPLE 1
APPLE 2
BANNA 1
BANANA 2
any of you geniuses have any suggestions, if this would work in Mysql
or should I have separate tables for the Title list and item entries. My other idea is to select all the titles from a title table , then as I go down the title table , select all the entries in the item table and list them by number, this would work but needs an extra table and a couple extra lines of code, and we wouldnt want that.