2016-05-16 23 views

回答

1

一個簡單的方法來實現這一目標是一樣的東西:

select cust_id, max(case when ind = 'Y' then 1 else 0 end) as flag from customers group by cust_id; 
+0

感謝馬克和它的工作,但我想你忘記通過CUST_ID包含組。 – Naveen

+0

是的,你是對的。對不起,我更新了答案.. – mgaido