SQLQuery3 (Hari Ke-2)
SQLQuery3 (Hari Ke-2)
financial where
[Units_Sold]>1000;
update production.keuangan
set kode_negara=(select substring(country,1,2)
from production.keuangan
where kode_negara is null
Select country,kode_negara=
case country
when 'canada' then 'Ca'
when 'malaysia' then 'Ma'
when 'Indonesia' then 'Idn'
else 'Kosong'
END
from production.keuangan
Select country,product,units_sold,sales,profit
into production.keuangan
from production.financial
alter table production.keuangan
add kode_negara char(20) null
Select country,
case country
when 'canada' then 'Ca'
when 'malaysia' then 'Ma'
when 'Indonesia' then 'Idn'
else 'Kosong'
END kode_negara
from production.keuangan