Well, here i am again. Next 1 month maybe my last time in XL, but consider about my friends advice i think about to postpone my plan to quit this job.
Sekarang saatnya backup my notes. This time about teradata. Here’s my tomboy..

Teradata

select * from dbc.tables
where databasename = ‘yourdb’;

select * from dbc.columns
where tablename = ‘yourtable’
and databasename = ‘yourdb’;

implicit cast : b_no(dec(20,0))(varchar(20))

select top 10 left(etl_date_id,length(etl_date_id)-1) from com_corporate;

select top 10 left(trim(msisdn (dec(35,0))),length(trim(msisdn (dec(35,0))))-1) as “MSISDN” from mds_corp_post_temp_5;

service_code = service_key + service_filter (xl_ref.dim_product)

ALTER TABLE RETAIL.EMPLOYEE DROP COLUMN EmpNo ;
drop column

62817144377

tanggal 28 reload tanggal 29
w2p kecil
400
100
jam 11 59 pm
complain kecil

convert decimal to varchar smoothly
select cast( cast( prim_resource_val AS format ‘Z(I)’ ) AS varchar(30))
from com_corporate where subscriber_type=’GSM Y’

merubah organisasi,
merubah idm

to: ivan,sigit,yoyo

dwi:
record2 ini tercapture, export attach januar, sql.
please recheck and make

cast( cast((b_no(float)(dec(20,0))) AS format ‘Z(I)’ ) AS varchar(30))
float to varchar
.export data file = ‘$folder’ — > export data tanpa header

select top 1 CAST( CAST(data_date AS BIGINT) AS VARCHAR(8)) (TITLE ”)
from xl_subs.subscriber_ai_today ; — > export no title

coalesce(cast(date_of_call as date), DATE ‘4712-12-31′)
timestamp to date

SELECT dt, tm,
cast( dt AS timestamp(0)) +
(tm – time ’00:00:00’ hour TO second) ts
FROM table –> combine date and time to timestamp

Liat jenis hp
select top 10 * from xl_rcg.adjust_balance_det/usage(subs_no)
–cari subs_no
select top 10 * from xl_eir.lup_det_ai_201105
–cari imsi substr(1,8)
select top 10 * from xl_ref.DIM_EQP
–cari brand and model

td_view
td_view

select (case
when a.sap_material like ‘%C2C%’ then substr(a.sap_material,1,(index(a.sap_material,’C2C’) – 1))||’C2CJ’||substr(a.sap_material,
index(a.sap_material,’C2C’)+char_length(‘C2C’),length(a.sap_material))
else
a.sap_material end) sap_material
from xl_rcg.bj_trans_stg a
——- di oracle dibawah
select DECODE(a.sap_material_region,’C2C’,’C2CJ’,a.sap_material_region)
merubah karakter C2C menjadi C2CJ pada field