View Single Post
Old 11-01-2009, 07:02 PM   #1 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default Multiple WHERE clause for each column?

Does anybody know if it's possible in MySQL to attach seperate WHERE clauses to each column being selected in a single query?

I'm running three queries to get data from a single table (so I can't use a join, afaik), which retrieves five columns. One column is the same amongst all three queries, and is how I join them in PHP afterwards. The first query selects two more individual columns, and the second and third one more each.

What I'd like to do is something akin to (and I know this is improper syntax, it's for demonstration of the concept):

php Code:
SELECT column WHERE column = this, column_two WHERE column_two = this FROM table

If it's possible, it would be much simpler than looping through and merging the results after the fact.
delayedinsanity is offline  
Reply With Quote