![]() Preserved Topic: How to order by 2 columns in 2 tables |
|
---|---|
Author | Thread |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() I have 2 tables, one holds rankings and the other holds content. The content table is ordered by a bigint autoincrement. The rankings table is ordered by the same id held in its table. The problem here is that not all the content elements have a ranking. |
Maniac (V) Mad Scientist with Finglongers From: Cell 53, East Wing |
![]() WarMage: Could you not first pull out everything with a rank and then pull out everything without one. I'm not sure how simple the latter would be and, if it can't be done simply, you may have to store the IDs with a ranking in an array as you output them then do a second search and just not echo a result that has a matching ID in the array. That is the why I'd try it but I'd need to play around with things. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() |
Paranoid (IV) Inmate From: 127.0.0.1 |
![]() |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() How about something like |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() Wait let's see that's not gonna return all the content id's |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() |
Maniac (V) Mad Scientist From: 100101010011 <-- right about here |
![]() The distinct is just a habit I got into at work mostly because everyone else does it it just excludes duplicate entries and is not really necessary here. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
![]() |