|
-
Running Plodding & Limping
mySql question, not sure if its a Union or Join issue...
Hi I'm trying to do something quite simple but can't quite get my head round it and get the results to come out how I want them.
Say you have a load of cufflinks and you want to classify them for a database, some of the cufflinks might be simple, i.e all made out of white gold, some might be all yellow gold, others might be made out of both white and yellow so you have some overlapping classes.
I've got my db set up so "class1" is my primary and "class2" is my secondary. So if I've got a cufflink thats predominantly yellow gold but with a little bit of white I'll have "class1" set as "yg" and "class2" as "wg".
brief example...
I wanna see all cufflinks that feature "wg" so I've got something like..
SELECT * FROM myTable WHERE (class1 = "wg" OR class2 = "wg");
The results come out in an order like 1,2,3,4,5. What I really want is for the class1 results to take priority so the results should come out as 1,2,3,5,4.
I hope that makes sense, anybody know how you give one column priority over another in the same table?
Cheers
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|