select a.subscriber_msisdn, war.created_datetime from
(
select distinct subscriber_msisdn from wiz_application_response
where application_item_id in
(select id from wiz_application_item where application_id=155)
and created_datetime between '2012-10-07 00:00' and '2012-11-15 00:00:54'
) a
left outer join wiz_application_response war on (war.subscriber_msisdn=a.subscriber_msisdn)
子選擇返回11行,但是當連接返回18(帶有重複項)時。此查詢的目的只是將日期列添加到子選擇的11行。選擇不同於2列,但只有1個是重複的
我沒有看到表格定義,示例數據或PostgreSQL版本。 –