bazz
02-08-2008, 04:10 PM
Hi,
I am trying to select three fields from one table and to get each of the range of values, ordered 'alphanumerically'.
Please point me to a MySQL key word (eg DISTINCT, UNIQUE SUM COUNT etc) (I now its none of them lol), which can change this table layout to the results shown below.
tbl_types
type | sub_type | category |
Accommodation | Hotel 5 Star |
Accommodation | Guesthouse | 3 Star |
Accommodation | Bed and Breakfast | Certified |
Accommodation | Hotel | 3 star |
This table will always have jumbled up records because new types are added as required.
I want the output to be like this (well, with Accommodation only showing once - so without duplicates).
Accommodation - Bed and Breakfast - Certified
Accommodation - Guesthouse - 2 Star
Accommodation - Guesthouse - 3 Star
Accommodation - Guesthouse - 4 Star
Accommodation - Guesthouse - 5 Star
Accommodation - Hotel - 2 Star
Accommodation - Hotel - 3 Star
Accommodation - Hotel - 4 Star
Accommodation - Hotel - 5 Star
Attractions - Cultural - Architectural
Attractions - Recreation - Wildlife
See how each record is alphabetical or numerically ordered in line wioth its previous field.
I don't know the name of what I am looking for.
bazz
I am trying to select three fields from one table and to get each of the range of values, ordered 'alphanumerically'.
Please point me to a MySQL key word (eg DISTINCT, UNIQUE SUM COUNT etc) (I now its none of them lol), which can change this table layout to the results shown below.
tbl_types
type | sub_type | category |
Accommodation | Hotel 5 Star |
Accommodation | Guesthouse | 3 Star |
Accommodation | Bed and Breakfast | Certified |
Accommodation | Hotel | 3 star |
This table will always have jumbled up records because new types are added as required.
I want the output to be like this (well, with Accommodation only showing once - so without duplicates).
Accommodation - Bed and Breakfast - Certified
Accommodation - Guesthouse - 2 Star
Accommodation - Guesthouse - 3 Star
Accommodation - Guesthouse - 4 Star
Accommodation - Guesthouse - 5 Star
Accommodation - Hotel - 2 Star
Accommodation - Hotel - 3 Star
Accommodation - Hotel - 4 Star
Accommodation - Hotel - 5 Star
Attractions - Cultural - Architectural
Attractions - Recreation - Wildlife
See how each record is alphabetical or numerically ordered in line wioth its previous field.
I don't know the name of what I am looking for.
bazz