Hello!
I'm just posting to know if you can run a select statement where each column you're looking for could have different criteria? And if so, what's the syntax for the statement.
The pseudocode for what I'm looking for is like
select COLUMN1, COLUMN2 from TABLE1 as A, TABLE1 as B where
{CRITERIA for COLUMN1}
{CRITERIA for COLUMN2 that is different than CRITERIA from COLUMN1 but doesn't apply to COLUMN1};
The only other way I can think to do this is to run 2 separate queries, and then join them, but this involves creating 2 temp tables to store those queries.
Is there a way to do what I'm asking or atleast a more efficient way?
Thanks.
I'm just posting to know if you can run a select statement where each column you're looking for could have different criteria? And if so, what's the syntax for the statement.
The pseudocode for what I'm looking for is like
select COLUMN1, COLUMN2 from TABLE1 as A, TABLE1 as B where
{CRITERIA for COLUMN1}
{CRITERIA for COLUMN2 that is different than CRITERIA from COLUMN1 but doesn't apply to COLUMN1};
The only other way I can think to do this is to run 2 separate queries, and then join them, but this involves creating 2 temp tables to store those queries.
Is there a way to do what I'm asking or atleast a more efficient way?
Thanks.