I want to do a query where I end up cross joining the results of 2 unions. While union operates on two select statements, cross join operates within a select statement, and I'm at a loss for how to reconcile the syntax.
To avoid going into the complexities of my queries which are irrelevant to my question, let me give a very simple example, of having a query like
select 'a', 'b' union select 'aa', 'bb'
which I wish to cross join with
select 'c', 'd' union select 'cc', 'dd'
I can solve this by turning each of my two union queries into a view and then do a cross join on the 2 views. However it seems silly to have to do this, so I thought I would throw this out there in case anyone knows how to make this all work as single query.
Thanks,
Eric
To avoid going into the complexities of my queries which are irrelevant to my question, let me give a very simple example, of having a query like
select 'a', 'b' union select 'aa', 'bb'
which I wish to cross join with
select 'c', 'd' union select 'cc', 'dd'
I can solve this by turning each of my two union queries into a view and then do a cross join on the 2 views. However it seems silly to have to do this, so I thought I would throw this out there in case anyone knows how to make this all work as single query.
Thanks,
Eric