Thread: Help with Query
View Single Post
Old 09-17-2012, 06:09 AM   PM User | #3
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,168
Thanks: 59
Thanked 3,993 Times in 3,962 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
I dunno GuelphDad. From the way he wrote that, I think he wants to get *ALL* the names with their picks from week1 and week2. You could do that via MySQL/PHP, but I suspect it would be "neater" to do it all in SQL
Code:
SELECT t1.name, t1.pickid AS week1pick, t2.pickid AS week2pick
FROM yourtable AS t1, yourtable AS t2
WHERE t1.name = t2.name
AND t1.week = 1
AND t2.week = 2
ORDER BY t1.name
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote