0
with temp as(
select a.fk_audit_inserimento
from mtd.t_mtd_all_dt_elab_etl a,mtd.t_mtd_all_dt_anag_etl b
where a.fk_etl_caricamento=b.pk_etl_caricamento
and b.sds_livello='DMT' and b.sds_nome_etl='JOB_DM_MOBILE_CODE'
order by 1 desc
limit 2
)
select
case
when
(select count(*) from temp)=1
then
(select 19000101000000,
union
select fk_audit_inserimento from temp)
when
(select count(*) from temp)=2
then (select fk_audit_inserimento from temp)
end
我想這 If count (*) of TEMP =1
那麼我想兩個記錄19000101000000
表達一個子查詢返回多行和select fk_audit_inserimento from temp;
If count(*) of TEMP =2
那麼我想select fk_audit_inserimento from temp.
Postgres的情況下錯誤:通過使用
但我
ERROR: multiple rows.
我該如何解決?
THANKS