Multiple selects in one
Date: Wed, 10 Mar 2010 13:49:19 -0800 (PST)
I'm trying to write a query that will combine multiple rows from the same table into one row. That can be done with each column being a SELECT statement.
However, in my case each column has different criteria and I'm running into a problem where if any of the criteria from any of the queries is false, the entire query returns nothing.
SELECT customer_id, customer_name, new_order_id, old_order_id......... FROM (SELECT customer_id, customer_name, new_order_id
FROM...... WHERE........), (SELECT old_order_id FROM...... WHERE........)
Basically I'm applying separate criteria to each column. How can I allow any of the column queries to be false and just return NULL or whatever instead of the entire query failing? Received on Wed Mar 10 2010 - 15:49:19 CST