0

此查询带回如下结果:select distinct date from dwh.product_count

April, 2013
March, 2013
February, 2013
January, 2013

我想附加许多结果 ^that^ 带回此查询的结果:

select distinct p_id dwh.members a

5
7
8
...etc

所以我的结果看起来像这样:

5    April, 2013
5    March, 2013
5    February, 2013
5    January, 2013
7    April, 2013
7    March, 2013
7    February, 2013
7    January, 2013
etc....

什么类型的查询会带来这些结果?

4

2 回答 2

2
select id, dt
from 
    (select distinct p_id as id from dwh.members) s
    cross join
    (select distinct date as dt from dwh.product_count) t
于 2013-05-09T14:07:01.157 回答
1
select id, dt from 
( select distinct p_id as id from dwh.members )
.( select distinct date as dt from dwh.product_count )
于 2013-05-09T13:44:05.527 回答