Keje..keje..n keje
Wednesday, March 18, 2009 by aiManYgCoMeL
HAri ni..hujan dr kul 5am lagik..
sejuk xpyh nak habaq la..hhuhuhu
sampai ke sumsum tulang
baru je cadang nak nek moto p keje..
tp dah hujan..terpaksa la nek kete...
demam aku baru nak bek..
tp alhamdulillah semua perjalanan keje aku berjalan lancar..
walaupun sedikikit susah nak memulakan tgs baru aku dlm SQL syntax...
pening..
dah table besar n banyak..
nak tgk satu n satu...
k la nak sambung wat keje...
nila contoh SQL syntax yang aku kene wat..
select case region_code
when 'KDP' then 'Kedah Perlis'
when 'PRK' then 'Perak'
when 'PNG' then 'Penang'
when 'SBH' then 'Sabah'
when 'SWK' then 'Sarawak'
end as region,
a.location_code,c.location_name,a.asset_no,
case a.asset_category
when 'A' then 'Equipment'
when 'S' then 'System'
when 'B' then 'Building'
when 'L' then 'Land'
when 'N' then 'Location'
end as category,
a.type_code,b.[description],a.commissioning_date,a.pur_date,a.service
from eng_ipoh..eng_asset_master a
left join common..eng_asset_type_master b
on (a.company_code = b.company_code and a.type_code = b.type_code and a.service = b.service and a.asset_category = b.asset_category)
left join common..csec_location_master c
on (a.company_code = c.company_code and a.location_code = c.location_code)
where a.company_code = 'FMSGPFM1'
and a.ownership = 'M'
--and a.service = 'FEMS'
and a.pur_date < '1997-01-01 00:00:00.000'
and a.commissioning_date < '1997-01-01 00:00:00.000'
order by a.location_code,a.asset_no,a.service
Mood : ngantuk..xsabr tggu gaji n rindu emilia...
sejuk xpyh nak habaq la..hhuhuhu
sampai ke sumsum tulang
baru je cadang nak nek moto p keje..
tp dah hujan..terpaksa la nek kete...
demam aku baru nak bek..
tp alhamdulillah semua perjalanan keje aku berjalan lancar..
walaupun sedikikit susah nak memulakan tgs baru aku dlm SQL syntax...
pening..
dah table besar n banyak..
nak tgk satu n satu...
k la nak sambung wat keje...
nila contoh SQL syntax yang aku kene wat..
select case region_code
when 'KDP' then 'Kedah Perlis'
when 'PRK' then 'Perak'
when 'PNG' then 'Penang'
when 'SBH' then 'Sabah'
when 'SWK' then 'Sarawak'
end as region,
a.location_code,c.location_name,a.asset_no,
case a.asset_category
when 'A' then 'Equipment'
when 'S' then 'System'
when 'B' then 'Building'
when 'L' then 'Land'
when 'N' then 'Location'
end as category,
a.type_code,b.[description],a.commissioning_date,a.pur_date,a.service
from eng_ipoh..eng_asset_master a
left join common..eng_asset_type_master b
on (a.company_code = b.company_code and a.type_code = b.type_code and a.service = b.service and a.asset_category = b.asset_category)
left join common..csec_location_master c
on (a.company_code = c.company_code and a.location_code = c.location_code)
where a.company_code = 'FMSGPFM1'
and a.ownership = 'M'
--and a.service = 'FEMS'
and a.pur_date < '1997-01-01 00:00:00.000'
and a.commissioning_date < '1997-01-01 00:00:00.000'
order by a.location_code,a.asset_no,a.service
Mood : ngantuk..xsabr tggu gaji n rindu emilia...