This SQL query performs a data type conversion and column selection operation on a staging table for SAP BKPF (Accounting Document Header) data. It casts various fields to specific data types (mostly TEXT, with some DECIMAL and TIMESTAMP) and selects a subset of columns from the original table. The query doesn't perform any filtering, aggregation, or complex transformations.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__bkpf_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS _sapf15_status,
CAST(NULL AS TEXT) AS adisc,
CAST(NULL AS TEXT) AS aedat,
CAST(NULL AS TEXT) AS arcid,
CAST(NULL AS TEXT) AS ausbk,
CAST(NULL AS TEXT) AS awkey,
CAST(NULL AS TEXT) AS awsys,
CAST(NULL AS TEXT) AS awtyp,
CAST(NULL AS TEXT) AS basw2,
CAST(NULL AS TEXT) AS basw3,
CAST(NULL AS TEXT) AS batch,
CAST(NULL AS TEXT) AS belnr,
CAST(NULL AS TEXT) AS bktxt,
CAST(NULL AS TEXT) AS blart,
CAST(NULL AS TEXT) AS bldat,
CAST(NULL AS TEXT) AS blind,
CAST(NULL AS TEXT) AS brnch,
CAST(NULL AS TEXT) AS bstat,
CAST(NULL AS TEXT) AS budat,
CAST(NULL AS TEXT) AS bukrs,
CAST(NULL AS TEXT) AS bvorg,
CAST(NULL AS TEXT) AS cash_alloc,
CAST(NULL AS TEXT) AS ccins,
CAST(NULL AS TEXT) AS ccnum,
CAST(NULL AS TEXT) AS cpudt,
CAST(NULL AS TEXT) AS cputm,
CAST(NULL AS DECIMAL(28, 6)) AS ctxkrs,
CAST(NULL AS TEXT) AS curt2,
CAST(NULL AS TEXT) AS curt3,
CAST(NULL AS TEXT) AS dbblg,
CAST(NULL AS TEXT) AS doccat,
CAST(NULL AS TEXT) AS dokid,
CAST(NULL AS TEXT) AS duefl,
CAST(NULL AS TEXT) AS exclude_flag,
CAST(NULL AS TEXT) AS fikrs,
CAST(NULL AS TEXT) AS fm_umart,
CAST(NULL AS TEXT) AS follow_on,
CAST(NULL AS DECIMAL(28, 6)) AS frath,
CAST(NULL AS TEXT) AS gjahr,
CAST(NULL AS TEXT) AS glvor,
CAST(NULL AS TEXT) AS grpid,
CAST(NULL AS TEXT) AS hwae2,
CAST(NULL AS TEXT) AS hwae3,
CAST(NULL AS TEXT) AS hwaer,
CAST(NULL AS TEXT) AS iblar,
CAST(NULL AS TEXT) AS intdate,
CAST(NULL AS TEXT) AS intform,
CAST(NULL AS TEXT) AS knumv,
CAST(NULL AS DECIMAL(28, 6)) AS kur2x,
CAST(NULL AS DECIMAL(28, 6)) AS kur3x,
CAST(NULL AS DECIMAL(28, 6)) AS kurs2,
CAST(NULL AS DECIMAL(28, 6)) AS kurs3,
CAST(NULL AS DECIMAL(28, 6)) AS kursf,
CAST(NULL AS TEXT) AS kurst,
CAST(NULL AS DECIMAL(28, 6)) AS kursx,
CAST(NULL AS TEXT) AS kuty2,
CAST(NULL AS TEXT) AS kuty3,
CAST(NULL AS DECIMAL(28, 6)) AS kzkrs,
CAST(NULL AS TEXT) AS kzwrs,
CAST(NULL AS TEXT) AS ldgrp,
CAST(NULL AS TEXT) AS lotkz,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS monat,
CAST(NULL AS TEXT) AS numpg,
CAST(NULL AS TEXT) AS offset_refer_dat,
CAST(NULL AS TEXT) AS offset_status,
CAST(NULL AS TEXT) AS penrc,
CAST(NULL AS TEXT) AS ppnam,
CAST(NULL AS TEXT) AS propmano,
CAST(NULL AS TEXT) AS psoak,
CAST(NULL AS TEXT) AS psobt,
CAST(NULL AS TEXT) AS psodt,
CAST(NULL AS TEXT) AS psofn,
CAST(NULL AS TEXT) AS psoks,
CAST(NULL AS TEXT) AS psosg,
CAST(NULL AS TEXT) AS psotm,
CAST(NULL AS TEXT) AS psoty,
CAST(NULL AS TEXT) AS psozl,
CAST(NULL AS TEXT) AS reindat,
CAST(NULL AS TEXT) AS resubmission,
CAST(NULL AS TEXT) AS rldnr,
CAST(NULL AS TEXT) AS sampled,
CAST(NULL AS TEXT) AS sname,
CAST(NULL AS TEXT) AS ssblk,
CAST(NULL AS TEXT) AS stblg,
CAST(NULL AS TEXT) AS stgrd,
CAST(NULL AS TEXT) AS stjah,
CAST(NULL AS TEXT) AS stodt,
CAST(NULL AS TEXT) AS subset,
CAST(NULL AS TEXT) AS tcode,
CAST(NULL AS DECIMAL(28, 6)) AS txkrs,
CAST(NULL AS TEXT) AS umrd2,
CAST(NULL AS TEXT) AS umrd3,
CAST(NULL AS TEXT) AS upddt,
CAST(NULL AS TEXT) AS usnam,
CAST(NULL AS TEXT) AS vatdate,
CAST(NULL AS TEXT) AS waers,
CAST(NULL AS TEXT) AS wwert,
CAST(NULL AS TEXT) AS xblnr,
CAST(NULL AS TEXT) AS xblnr_alt,
CAST(NULL AS TEXT) AS xmca,
CAST(NULL AS TEXT) AS xmwst,
CAST(NULL AS TEXT) AS xnetb,
CAST(NULL AS TEXT) AS xref1_hd,
CAST(NULL AS TEXT) AS xref2_hd,
CAST(NULL AS TEXT) AS xreorg,
CAST(NULL AS TEXT) AS xreversal,
CAST(NULL AS TEXT) AS xrueb,
CAST(NULL AS TEXT) AS xsnet,
CAST(NULL AS TEXT) AS xsplit,
CAST(NULL AS TEXT) AS xstov,
CAST(NULL AS TEXT) AS xusvr,
CAST(NULL AS TEXT) AS xwvof
FROM base
), final AS (
SELECT
CAST(mandt AS TEXT) AS mandt,
CAST(bukrs AS TEXT) AS bukrs,
CAST(belnr AS TEXT) AS belnr,
CAST(gjahr AS TEXT) AS gjahr,
blart,
bldat,
monat,
cpudt,
xblnr,
waers,
glvor,
awkey,
fikrs,
hwaer,
hwae2,
hwae3,
awsys,
ldgrp,
kursf,
xreorg
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
gjahr | None | Fiscal year |
bukrs | None | Company code |
belnr | None | Accounting document number |
blart | None | Document type |
bldat | None | Document date in document |
monat | None | Fiscal period |
cpudt | None | Day on which accounting document was entered |
xblnr | None | Reference document number |
waers | None | Currency key |
glvor | None | Business transaction |
awkey | None | Reference key |
fikrs | None | Financial management area |
hwaer | None | Local currency |
hwae2 | None | Currency key of second local currency |
hwae3 | None | Currency key of third local currency |
awsys | None | Logical system |
ldgrp | None | Ledger group |
kursf | None | Exchange rate |
xreorg | None | Doc. contains open item that was transferred during reorg. |
MANDT | TEXT | None |
BUKRS | TEXT | None |
BELNR | TEXT | None |
GJAHR | TEXT | None |
BLART | TEXT | None |
BLDAT | TEXT | None |
MONAT | NUMBER | None |
CPUDT | TEXT | None |
XBLNR | NUMBER | None |
WAERS | TEXT | None |
GLVOR | TEXT | None |
AWKEY | TEXT | None |
FIKRS | NUMBER | None |
HWAER | TEXT | None |
HWAE2 | TEXT | None |
HWAE3 | TEXT | None |
AWSYS | NUMBER | None |
LDGRP | NUMBER | None |
KURSF | NUMBER | None |
XREORG | NUMBER | None |
This SQL query selects all columns and rows from the 'bkpf' table in the 'sap' schema of the 'TEST' database. It is a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.bkpf
Name | Type | Comment |
---|---|---|
BELNR | TEXT | None |
BUKRS | NUMBER | None |
GJAHR | NUMBER | None |
MANDT | NUMBER | None |
BLART | TEXT | None |
BLDAT | TEXT | None |
BUDAT | TEXT | None |
MONAT | NUMBER | None |
CPUDT | TEXT | None |
CPUTM | TEXT | None |
AEDAT | TEXT | None |
UPDDT | TEXT | None |
WWERT | TEXT | None |
USNAM | TEXT | None |
TCODE | TEXT | None |
BVORG | NUMBER | None |
XBLNR | NUMBER | None |
DBBLG | NUMBER | None |
STBLG | NUMBER | None |
STJAH | NUMBER | None |
BKTXT | NUMBER | None |
WAERS | TEXT | None |
KURSF | NUMBER | None |
KZWRS | NUMBER | None |
KZKRS | NUMBER | None |
BSTAT | NUMBER | None |
XNETB | NUMBER | None |
FRATH | NUMBER | None |
XRUEB | NUMBER | None |
GLVOR | TEXT | None |
GRPID | NUMBER | None |
DOKID | NUMBER | None |
ARCID | NUMBER | None |
IBLAR | NUMBER | None |
AWTYP | TEXT | None |
AWKEY | TEXT | None |
FIKRS | NUMBER | None |
HWAER | TEXT | None |
HWAE2 | TEXT | None |
HWAE3 | TEXT | None |
KURS2 | NUMBER | None |
KURS3 | NUMBER | None |
BASW2 | NUMBER | None |
BASW3 | NUMBER | None |
UMRD2 | NUMBER | None |
UMRD3 | NUMBER | None |
XSTOV | NUMBER | None |
STODT | TEXT | None |
XMWST | NUMBER | None |
CURT2 | NUMBER | None |
CURT3 | NUMBER | None |
KUTY2 | TEXT | None |
KUTY3 | TEXT | None |
XSNET | NUMBER | None |
AUSBK | NUMBER | None |
XUSVR | NUMBER | None |
DUEFL | NUMBER | None |
AWSYS | NUMBER | None |
TXKRS | NUMBER | None |
CTXKRS | NUMBER | None |
LOTKZ | NUMBER | None |
XWVOF | NUMBER | None |
STGRD | NUMBER | None |
PPNAM | NUMBER | None |
BRNCH | NUMBER | None |
NUMPG | NUMBER | None |
ADISC | NUMBER | None |
XREF1_HD | NUMBER | None |
XREF2_HD | NUMBER | None |
XREVERSAL | NUMBER | None |
REINDAT | TEXT | None |
RLDNR | NUMBER | None |
LDGRP | NUMBER | None |
PROPMANO | NUMBER | None |
XBLNR_ALT | NUMBER | None |
VATDATE | NUMBER | None |
DOCCAT | NUMBER | None |
XSPLIT | NUMBER | None |
CASH_ALLOC | NUMBER | None |
FOLLOW_ON | NUMBER | None |
XREORG | NUMBER | None |
SUBSET | NUMBER | None |
KURST | NUMBER | None |
KURSX | NUMBER | None |
KUR2X | NUMBER | None |
KUR3X | NUMBER | None |
XMCA | NUMBER | None |
RESUBMISSION | NUMBER | None |
_SAPF15_STATUS | NUMBER | None |
PSOTY | NUMBER | None |
PSOAK | NUMBER | None |
PSOKS | NUMBER | None |
PSOSG | NUMBER | None |
PSOFN | NUMBER | None |
INTFORM | NUMBER | None |
INTDATE | NUMBER | None |
PSOBT | NUMBER | None |
PSOZL | NUMBER | None |
PSODT | NUMBER | None |
PSOTM | NUMBER | None |
FM_UMART | NUMBER | None |
CCINS | NUMBER | None |
CCNUM | NUMBER | None |
SSBLK | NUMBER | None |
BATCH | NUMBER | None |
SNAME | NUMBER | None |
SAMPLED | NUMBER | None |
EXCLUDE_FLAG | NUMBER | None |
BLIND | NUMBER | None |
OFFSET_STATUS | NUMBER | None |
OFFSET_REFER_DAT | NUMBER | None |
PENRC | NUMBER | None |
KNUMV | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query appears to be a data transformation and type casting operation. It starts with a base table, creates a fields CTE where it casts numerous columns to specific data types (mostly TEXT and DECIMAL), and then selects a subset of these fields in the final CTE. The query doesn't perform any filtering, aggregation, or complex transformations, but rather focuses on standardizing the data types of the columns and selecting specific fields from the original dataset.
CleaningOtherWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__bseg_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS abper,
CAST(NULL AS DECIMAL(28, 6)) AS absbt,
CAST(NULL AS DECIMAL(28, 6)) AS agzei,
CAST(NULL AS TEXT) AS altkt,
CAST(NULL AS TEXT) AS anbwa,
CAST(NULL AS TEXT) AS anfae,
CAST(NULL AS TEXT) AS anfbj,
CAST(NULL AS TEXT) AS anfbn,
CAST(NULL AS TEXT) AS anfbu,
CAST(NULL AS TEXT) AS anln1,
CAST(NULL AS TEXT) AS anln2,
CAST(NULL AS TEXT) AS aplzl,
CAST(NULL AS TEXT) AS aufnr,
CAST(NULL AS TEXT) AS aufpl,
CAST(NULL AS TEXT) AS augbl,
CAST(NULL AS TEXT) AS augcp,
CAST(NULL AS TEXT) AS augdt,
CAST(NULL AS TEXT) AS auggj,
CAST(NULL AS DECIMAL(28, 6)) AS bdif2,
CAST(NULL AS DECIMAL(28, 6)) AS bdif3,
CAST(NULL AS DECIMAL(28, 6)) AS bdiff,
CAST(NULL AS TEXT) AS belnr,
CAST(NULL AS TEXT) AS bewar,
CAST(NULL AS DECIMAL(28, 6)) AS blnbt,
CAST(NULL AS TEXT) AS blnkz,
CAST(NULL AS DECIMAL(28, 6)) AS blnpz,
CAST(NULL AS DECIMAL(28, 6)) AS bonfb,
CAST(NULL AS DECIMAL(28, 6)) AS bpmng,
CAST(NULL AS TEXT) AS bprme,
CAST(NULL AS TEXT) AS bschl,
CAST(NULL AS TEXT) AS btype,
CAST(NULL AS DECIMAL(28, 6)) AS bualt,
CAST(NULL AS TEXT) AS budget_pd,
CAST(NULL AS TEXT) AS bukrs,
CAST(NULL AS TEXT) AS bupla,
CAST(NULL AS TEXT) AS bustw,
CAST(NULL AS TEXT) AS buzei,
CAST(NULL AS TEXT) AS buzid,
CAST(NULL AS TEXT) AS bvtyp,
CAST(NULL AS TEXT) AS bwkey,
CAST(NULL AS TEXT) AS bwtar,
CAST(NULL AS TEXT) AS bzdat,
CAST(NULL AS TEXT) AS ccbtc,
CAST(NULL AS TEXT) AS cession_kz,
CAST(NULL AS TEXT) AS dabrz,
CAST(NULL AS TEXT) AS depot,
CAST(NULL AS TEXT) AS diekz,
CAST(NULL AS TEXT) AS disbj,
CAST(NULL AS TEXT) AS disbn,
CAST(NULL AS TEXT) AS disbz,
CAST(NULL AS DECIMAL(28, 6)) AS dmb21,
CAST(NULL AS DECIMAL(28, 6)) AS dmb22,
CAST(NULL AS DECIMAL(28, 6)) AS dmb23,
CAST(NULL AS DECIMAL(28, 6)) AS dmb31,
CAST(NULL AS DECIMAL(28, 6)) AS dmb32,
CAST(NULL AS DECIMAL(28, 6)) AS dmb33,
CAST(NULL AS DECIMAL(28, 6)) AS dmbe2,
CAST(NULL AS DECIMAL(28, 6)) AS dmbe3,
CAST(NULL AS DECIMAL(28, 6)) AS dmbt1,
CAST(NULL AS DECIMAL(28, 6)) AS dmbt2,
CAST(NULL AS DECIMAL(28, 6)) AS dmbt3,
CAST(NULL AS DECIMAL(28, 6)) AS dmbtr,
CAST(NULL AS TEXT) AS docln,
CAST(NULL AS TEXT) AS dtws1,
CAST(NULL AS TEXT) AS dtws2,
CAST(NULL AS TEXT) AS dtws3,
CAST(NULL AS TEXT) AS dtws4,
CAST(NULL AS TEXT) AS ebeln,
CAST(NULL AS TEXT) AS ebelp,
CAST(NULL AS TEXT) AS egbld,
CAST(NULL AS TEXT) AS eglld,
CAST(NULL AS TEXT) AS egrup,
CAST(NULL AS TEXT) AS elikz,
CAST(NULL AS TEXT) AS empfb,
CAST(NULL AS TEXT) AS erfme,
CAST(NULL AS DECIMAL(28, 6)) AS erfmg,
CAST(NULL AS TEXT) AS esrnr,
CAST(NULL AS TEXT) AS esrpz,
CAST(NULL AS TEXT) AS esrre,
CAST(NULL AS TEXT) AS eten2,
CAST(NULL AS TEXT) AS etype,
CAST(NULL AS TEXT) AS fastpay,
CAST(NULL AS TEXT) AS fdgrp,
CAST(NULL AS TEXT) AS fdlev,
CAST(NULL AS TEXT) AS fdtag,
CAST(NULL AS DECIMAL(28, 6)) AS fdwbt,
CAST(NULL AS TEXT) AS filkd,
CAST(NULL AS TEXT) AS fipos,
CAST(NULL AS TEXT) AS fistl,
CAST(NULL AS TEXT) AS fkber,
CAST(NULL AS TEXT) AS fkber_long,
CAST(NULL AS TEXT) AS fkont,
CAST(NULL AS TEXT) AS fmfgus_key,
CAST(NULL AS TEXT) AS fmxdocln,
CAST(NULL AS TEXT) AS fmxdocnr,
CAST(NULL AS TEXT) AS fmxyear,
CAST(NULL AS TEXT) AS fmxzekkn,
CAST(NULL AS DECIMAL(28, 6)) AS fwbas,
CAST(NULL AS DECIMAL(28, 6)) AS fwzuz,
CAST(NULL AS DECIMAL(28, 6)) AS gbetr,
CAST(NULL AS TEXT) AS geber,
CAST(NULL AS TEXT) AS gityp,
CAST(NULL AS TEXT) AS gjahr,
CAST(NULL AS TEXT) AS glupm,
CAST(NULL AS TEXT) AS gmvkz,
CAST(NULL AS TEXT) AS grant_nbr,
CAST(NULL AS TEXT) AS gricd,
CAST(NULL AS TEXT) AS grirg,
CAST(NULL AS TEXT) AS gsber,
CAST(NULL AS TEXT) AS gvtyp,
CAST(NULL AS TEXT) AS hbkid,
CAST(NULL AS TEXT) AS hkont,
CAST(NULL AS TEXT) AS hktid,
CAST(NULL AS TEXT) AS hrkft,
CAST(NULL AS DECIMAL(28, 6)) AS hwbas,
CAST(NULL AS TEXT) AS hwmet,
CAST(NULL AS DECIMAL(28, 6)) AS hwzuz,
CAST(NULL AS TEXT) AS hzuon,
CAST(NULL AS TEXT) AS idxsp,
CAST(NULL AS TEXT) AS ignr_ivref,
CAST(NULL AS TEXT) AS imkey,
CAST(NULL AS TEXT) AS intreno,
CAST(NULL AS TEXT) AS j_1tpbupl,
CAST(NULL AS TEXT) AS kblnr,
CAST(NULL AS TEXT) AS kblpos,
CAST(NULL AS TEXT) AS kidno,
CAST(NULL AS TEXT) AS kkber,
CAST(NULL AS DECIMAL(28, 6)) AS klibt,
CAST(NULL AS TEXT) AS koart,
CAST(NULL AS TEXT) AS kokrs,
CAST(NULL AS TEXT) AS kontl,
CAST(NULL AS TEXT) AS kontt,
CAST(NULL AS TEXT) AS kostl,
CAST(NULL AS TEXT) AS kstar,
CAST(NULL AS TEXT) AS kstrg,
CAST(NULL AS TEXT) AS ktosl,
CAST(NULL AS TEXT) AS kunnr,
CAST(NULL AS DECIMAL(28, 6)) AS kursr,
CAST(NULL AS DECIMAL(28, 6)) AS kzbtr,
CAST(NULL AS TEXT) AS landl,
CAST(NULL AS TEXT) AS lifnr,
CAST(NULL AS TEXT) AS linfv,
CAST(NULL AS TEXT) AS lnran,
CAST(NULL AS TEXT) AS lokkt,
CAST(NULL AS TEXT) AS lstar,
CAST(NULL AS TEXT) AS lzbkz,
CAST(NULL AS TEXT) AS maber,
CAST(NULL AS TEXT) AS madat,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mansp,
CAST(NULL AS TEXT) AS manst,
CAST(NULL AS TEXT) AS matnr,
CAST(NULL AS TEXT) AS measure,
CAST(NULL AS TEXT) AS meins,
CAST(NULL AS DECIMAL(28, 6)) AS menge,
CAST(NULL AS TEXT) AS mndid,
CAST(NULL AS TEXT) AS mschl,
CAST(NULL AS TEXT) AS mwart,
CAST(NULL AS TEXT) AS mwsk1,
CAST(NULL AS TEXT) AS mwsk2,
CAST(NULL AS TEXT) AS mwsk3,
CAST(NULL AS TEXT) AS mwskz,
CAST(NULL AS DECIMAL(28, 6)) AS mwst2,
CAST(NULL AS DECIMAL(28, 6)) AS mwst3,
CAST(NULL AS DECIMAL(28, 6)) AS mwsts,
CAST(NULL AS DECIMAL(28, 6)) AS navfw,
CAST(NULL AS DECIMAL(28, 6)) AS navh2,
CAST(NULL AS DECIMAL(28, 6)) AS navh3,
CAST(NULL AS DECIMAL(28, 6)) AS navhw,
CAST(NULL AS DECIMAL(28, 6)) AS nebtr,
CAST(NULL AS TEXT) AS nplnr,
CAST(NULL AS DECIMAL(28, 6)) AS nprei,
CAST(NULL AS TEXT) AS obzei,
CAST(NULL AS TEXT) AS paobjnr,
CAST(NULL AS TEXT) AS pargb,
CAST(NULL AS TEXT) AS pasubnr,
CAST(NULL AS TEXT) AS pays_prov,
CAST(NULL AS TEXT) AS pays_tran,
CAST(NULL AS TEXT) AS pbudget_pd,
CAST(NULL AS DECIMAL(28, 6)) AS peinh,
CAST(NULL AS DECIMAL(28, 6)) AS pendays,
CAST(NULL AS DECIMAL(28, 6)) AS penfc,
CAST(NULL AS DECIMAL(28, 6)) AS penlc1,
CAST(NULL AS DECIMAL(28, 6)) AS penlc2,
CAST(NULL AS DECIMAL(28, 6)) AS penlc3,
CAST(NULL AS TEXT) AS penrc,
CAST(NULL AS TEXT) AS pernr,
CAST(NULL AS TEXT) AS perop_beg,
CAST(NULL AS TEXT) AS perop_end,
CAST(NULL AS TEXT) AS pfkber,
CAST(NULL AS TEXT) AS pgeber,
CAST(NULL AS TEXT) AS pgrant_nbr,
CAST(NULL AS DECIMAL(28, 6)) AS popts,
CAST(NULL AS TEXT) AS posn2,
CAST(NULL AS TEXT) AS ppa_ex_ind,
CAST(NULL AS DECIMAL(28, 6)) AS ppdif2,
CAST(NULL AS DECIMAL(28, 6)) AS ppdif3,
CAST(NULL AS DECIMAL(28, 6)) AS ppdiff,
CAST(NULL AS TEXT) AS pprct,
CAST(NULL AS TEXT) AS prctr,
CAST(NULL AS TEXT) AS prodper,
CAST(NULL AS TEXT) AS projk,
CAST(NULL AS TEXT) AS projn,
CAST(NULL AS TEXT) AS prznr,
CAST(NULL AS TEXT) AS psalt,
CAST(NULL AS TEXT) AS psegment,
CAST(NULL AS DECIMAL(28, 6)) AS pswbt,
CAST(NULL AS TEXT) AS pswsl,
CAST(NULL AS DECIMAL(28, 6)) AS pyamt,
CAST(NULL AS TEXT) AS pycur,
CAST(NULL AS DECIMAL(28, 6)) AS qbshb,
CAST(NULL AS DECIMAL(28, 6)) AS qsfbt,
CAST(NULL AS DECIMAL(28, 6)) AS qsshb,
CAST(NULL AS TEXT) AS qsskz,
CAST(NULL AS TEXT) AS qsznr,
CAST(NULL AS DECIMAL(28, 6)) AS rdif2,
CAST(NULL AS DECIMAL(28, 6)) AS rdif3,
CAST(NULL AS DECIMAL(28, 6)) AS rdiff,
CAST(NULL AS TEXT) AS re_account,
CAST(NULL AS TEXT) AS re_bukrs,
CAST(NULL AS TEXT) AS rebzg,
CAST(NULL AS TEXT) AS rebzj,
CAST(NULL AS TEXT) AS rebzt,
CAST(NULL AS TEXT) AS rebzz,
CAST(NULL AS TEXT) AS recid,
CAST(NULL AS TEXT) AS recrf,
CAST(NULL AS DECIMAL(28, 6)) AS rewrt,
CAST(NULL AS DECIMAL(28, 6)) AS rewwr,
CAST(NULL AS TEXT) AS rfzei,
CAST(NULL AS TEXT) AS rpacq,
CAST(NULL AS TEXT) AS rstgr,
CAST(NULL AS TEXT) AS ryacq,
CAST(NULL AS TEXT) AS saknr,
CAST(NULL AS TEXT) AS samnr,
CAST(NULL AS DECIMAL(28, 6)) AS sctax,
CAST(NULL AS TEXT) AS secco,
CAST(NULL AS TEXT) AS segment,
CAST(NULL AS TEXT) AS sgtxt,
CAST(NULL AS TEXT) AS shkzg,
CAST(NULL AS TEXT) AS shzuz,
CAST(NULL AS DECIMAL(28, 6)) AS skfbt,
CAST(NULL AS DECIMAL(28, 6)) AS sknt2,
CAST(NULL AS DECIMAL(28, 6)) AS sknt3,
CAST(NULL AS DECIMAL(28, 6)) AS sknto,
CAST(NULL AS TEXT) AS spgrc,
CAST(NULL AS TEXT) AS spgrg,
CAST(NULL AS TEXT) AS spgrm,
CAST(NULL AS TEXT) AS spgrp,
CAST(NULL AS TEXT) AS spgrq,
CAST(NULL AS TEXT) AS spgrs,
CAST(NULL AS TEXT) AS spgrt,
CAST(NULL AS TEXT) AS spgrv,
CAST(NULL AS TEXT) AS squan,
CAST(NULL AS TEXT) AS srtype,
CAST(NULL AS TEXT) AS stbuk,
CAST(NULL AS TEXT) AS stceg,
CAST(NULL AS TEXT) AS stekz,
CAST(NULL AS DECIMAL(28, 6)) AS sttax,
CAST(NULL AS TEXT) AS taxps,
CAST(NULL AS TEXT) AS tbtkz,
CAST(NULL AS DECIMAL(28, 6)) AS txbfw,
CAST(NULL AS DECIMAL(28, 6)) AS txbh2,
CAST(NULL AS DECIMAL(28, 6)) AS txbh3,
CAST(NULL AS DECIMAL(28, 6)) AS txbhw,
CAST(NULL AS TEXT) AS txdat,
CAST(NULL AS TEXT) AS txgrp,
CAST(NULL AS TEXT) AS txjcd,
CAST(NULL AS TEXT) AS umsks,
CAST(NULL AS TEXT) AS umskz,
CAST(NULL AS TEXT) AS uzawe,
CAST(NULL AS TEXT) AS valut,
CAST(NULL AS TEXT) AS vbel2,
CAST(NULL AS TEXT) AS vbeln,
CAST(NULL AS TEXT) AS vbewa,
CAST(NULL AS TEXT) AS vbund,
CAST(NULL AS TEXT) AS vertn,
CAST(NULL AS TEXT) AS vertt,
CAST(NULL AS TEXT) AS vname,
CAST(NULL AS TEXT) AS vorgn,
CAST(NULL AS TEXT) AS vprsv,
CAST(NULL AS TEXT) AS vptnr,
CAST(NULL AS TEXT) AS vrsdt,
CAST(NULL AS TEXT) AS vrskz,
CAST(NULL AS TEXT) AS werks,
CAST(NULL AS DECIMAL(28, 6)) AS wmwst,
CAST(NULL AS DECIMAL(28, 6)) AS wrbt1,
CAST(NULL AS DECIMAL(28, 6)) AS wrbt2,
CAST(NULL AS DECIMAL(28, 6)) AS wrbt3,
CAST(NULL AS DECIMAL(28, 6)) AS wrbtr,
CAST(NULL AS DECIMAL(28, 6)) AS wskto,
CAST(NULL AS TEXT) AS wverw,
CAST(NULL AS TEXT) AS xanet,
CAST(NULL AS TEXT) AS xauto,
CAST(NULL AS TEXT) AS xbilk,
CAST(NULL AS TEXT) AS xcpdd,
CAST(NULL AS TEXT) AS xegdr,
CAST(NULL AS TEXT) AS xfakt,
CAST(NULL AS TEXT) AS xfrge_bseg,
CAST(NULL AS TEXT) AS xhkom,
CAST(NULL AS TEXT) AS xhres,
CAST(NULL AS TEXT) AS xinve,
CAST(NULL AS TEXT) AS xkres,
CAST(NULL AS TEXT) AS xlgclr,
CAST(NULL AS TEXT) AS xncop,
CAST(NULL AS TEXT) AS xnegp,
CAST(NULL AS TEXT) AS xopvw,
CAST(NULL AS TEXT) AS xpanz,
CAST(NULL AS TEXT) AS xpypr,
CAST(NULL AS TEXT) AS xragl,
CAST(NULL AS TEXT) AS xref1,
CAST(NULL AS TEXT) AS xref2,
CAST(NULL AS TEXT) AS xref3,
CAST(NULL AS TEXT) AS xsauf,
CAST(NULL AS TEXT) AS xserg,
CAST(NULL AS TEXT) AS xskrl,
CAST(NULL AS TEXT) AS xskst,
CAST(NULL AS TEXT) AS xspro,
CAST(NULL AS TEXT) AS xuman,
CAST(NULL AS TEXT) AS xumsw,
CAST(NULL AS TEXT) AS xzahl,
CAST(NULL AS DECIMAL(28, 6)) AS zbd1p,
CAST(NULL AS DECIMAL(28, 6)) AS zbd1t,
CAST(NULL AS DECIMAL(28, 6)) AS zbd2p,
CAST(NULL AS DECIMAL(28, 6)) AS zbd2t,
CAST(NULL AS DECIMAL(28, 6)) AS zbd3t,
CAST(NULL AS TEXT) AS zbfix,
CAST(NULL AS TEXT) AS zekkn,
CAST(NULL AS TEXT) AS zfbdt,
CAST(NULL AS TEXT) AS zinkz,
CAST(NULL AS TEXT) AS zlsch,
CAST(NULL AS TEXT) AS zlspr,
CAST(NULL AS TEXT) AS zolld,
CAST(NULL AS TEXT) AS zollt,
CAST(NULL AS TEXT) AS zterm,
CAST(NULL AS TEXT) AS zumsk,
CAST(NULL AS TEXT) AS zuonr,
CAST(NULL AS TEXT) AS zzbuspartn,
CAST(NULL AS TEXT) AS zzchan,
CAST(NULL AS TEXT) AS zzlob,
CAST(NULL AS TEXT) AS zzloca,
CAST(NULL AS TEXT) AS zzproduct,
CAST(NULL AS TEXT) AS zzregion,
CAST(NULL AS TEXT) AS zzspreg,
CAST(NULL AS TEXT) AS zzstate,
CAST(NULL AS TEXT) AS zzuserfld1,
CAST(NULL AS TEXT) AS zzuserfld2,
CAST(NULL AS TEXT) AS zzuserfld3
FROM base
), final AS (
SELECT
CAST(mandt AS TEXT) AS mandt,
CAST(bukrs AS TEXT) AS bukrs,
CAST(belnr AS TEXT) AS belnr,
CAST(gjahr AS TEXT) AS gjahr,
CAST(buzei AS TEXT) AS buzei,
anln1,
anln2,
aufnr,
augbl,
augdt,
ebeln,
ebelp,
eten2,
filkd,
gsber,
koart,
kostl,
maber,
madat,
mansp,
manst,
mschl,
mwskz,
posn2,
qbshb,
qsfbt,
qsshb,
rebzg,
samnr,
sgtxt,
shkzg,
skfbt,
wskto,
sknto,
umsks,
umskz,
uzawe,
valut,
vbel2,
vbeln,
vbewa,
vbund,
vertn,
vertt,
werks,
wverw,
xzahl,
zbd1p,
zbd1t,
zbd2p,
zbd2t,
zbd3t,
zfbdt,
zlsch,
zlspr,
zterm,
zuonr,
xref1,
xref2,
rstgr,
rebzt,
pswsl,
pswbt,
hkont,
xnegp,
zbfix,
rfzei,
ccbtc,
kkber,
xref3,
dtws1,
dtws2,
dtws3,
dtws4,
absbt,
projk,
xpypr,
kidno,
bupla,
secco,
pycur,
pyamt,
xragl,
cession_kz,
buzid,
auggj,
agzei,
bdiff,
bdif2,
bdif3,
bewar,
dabrz,
dmbtr,
fkber,
fkber_long,
imkey,
kstar,
kunnr,
lifnr,
meins,
menge,
pargb,
pfkber,
pprct,
saknr,
wrbtr,
xopvw,
xlgclr,
zzspreg,
zzbuspartn,
zzproduct,
zzloca,
zzchan,
zzlob,
zzuserfld1,
zzuserfld2,
zzuserfld3,
zzregion,
zzstate
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
bukrs | None | Company code |
belnr | None | Accounting document number |
gjahr | None | Fiscal year |
buzei | None | Number of line item within accounting document |
anln1 | None | Main asset number |
anln2 | None | Asset subnumber |
aufnr | None | Order number |
augbl | None | Document number of the clearing document |
augdt | None | Clearing date |
ebeln | None | Purchasing document number |
ebelp | None | Item number of purchasing document |
eten2 | None | Delivery schedule line number |
filkd | None | Account number of the branch |
gsber | None | Business area |
koart | None | Account type |
kostl | None | Cost center |
maber | None | Dunning Area |
madat | None | Last dunned on |
mansp | None | Dunning block |
manst | None | Dunning level |
mschl | None | Dunning key |
mwskz | None | Tax on sales/purchases code |
posn2 | None | Sales document item |
qbshb | None | Withholding tax amount (in document currency) |
qsfbt | None | Withholding tax-exempt amount (in document currency) |
qsshb | None | Withholding tax base amount |
rebzg | None | Number of the invoice the transaction belongs to |
samnr | None | Invoice list number |
sgtxt | None | Item text |
shkzg | None | Debit/credit indicator |
skfbt | None | Amount eligible for cash discount in document currency |
wskto | None | Cash discount amount in document currency |
sknto | None | Cash discount amount in local currency |
umsks | None | Special G/L transaction type |
umskz | None | Special G/L indicator |
uzawe | None | Payment method supplement |
valut | None | Value date |
vbel2 | None | Sales document |
vbeln | None | Billing document |
vbewa | None | Flow type |
vbund | None | Company id of trading partner |
vertn | None | Contract number |
vertt | None | Contract type |
werks | None | Plant |
wverw | None | Bill of exchange usage type |
xzahl | None | Indicator (Is the posting key used in a payment transaction?) |
zbd1p | None | Cash discount percentage 1 |
zbd1t | None | Cash discount days 1 |
zbd2p | None | Cash discount percentage 2 |
zbd2t | None | Cash discount days 2 |
zbd3t | None | Net payment terms period |
zfbdt | None | Baseline date for due date calculation |
zlsch | None | Payment method |
zlspr | None | Payment block key |
zterm | None | Terms of payment key |
zuonr | None | Assignment number |
xref1 | None | Business partner reference key |
xref2 | None | Business partner reference key |
rstgr | None | Reason code for payments |
rebzt | None | Follow-on document type |
pswsl | None | Update currency for general ledger transaction figures |
pswbt | None | Amount for updating in general ledger |
hkont | None | General ledger account |
xnegp | None | Indicator (Negative posting) |
zbfix | None | Fixed payment terms |
rfzei | None | Payment card item |
ccbtc | None | Payment cards (Settlement run) |
kkber | None | Credit control area |
xref3 | None | Reference key for line item |
dtws1 | None | Instruction key 1 |
dtws2 | None | Instruction key 2 |
dtws3 | None | Instruction key 3 |
dtws4 | None | Instruction key 4 |
absbt | None | Credit management (Hedged amount) |
projk | None | Work Breakdown Structure Element (WBS Element) |
xpypr | None | Indicator (Items from payment program blocked) |
kidno | None | Payment reference |
bupla | None | Business place |
secco | None | Section code |
pycur | None | Currency for automatic payment |
pyamt | None | Amount in payment currency |
xragl | None | Indicator (Clearing was reversed) |
cession_kz | None | Accounts receivable pledging indicator |
buzid | None | Identification of the line item |
auggj | None | Fiscal year of clearing document |
agzei | None | Clearing item |
bdiff | None | Valuation difference |
bdif2 | None | Valuation difference for the second local currency |
bdif3 | None | Valuation difference for the third local currency |
bewar | None | Transaction type |
dabrz | None | Reference date for settlement |
dmbtr | None | Amount in local currency |
fkber | None | Functional area |
fkber_long | None | Functional area |
imkey | None | Internal key for real estate object |
kstar | None | Cost element |
kunnr | None | Customer numbers |
lifnr | None | Account number of vendor or creditor |
meins | None | Base unit of measure |
menge | None | Quantity |
pargb | None | Trading partner's business area |
pfkber | None | Partner functional area |
pprct | None | Partner profit center |
saknr | None | G/L account number |
wrbtr | None | Amount in document currency |
xopvw | None | Indicator (Open item management?) |
xlgclr | None | Clearing specific to ledger groups |
zzspreg | None | Special region |
zzbuspartn | None | Business partner |
zzproduct | None | Product group |
zzloca | None | City |
zzchan | None | Distribution channel |
zzlob | None | Business line |
zzuserfld1 | None | Territory |
zzuserfld2 | None | Owner/Cont. |
zzuserfld3 | None | Vein |
zzregion | None | User defined regions |
zzstate | None | State/province code |
MANDT | TEXT | None |
BUKRS | TEXT | None |
BELNR | TEXT | None |
GJAHR | TEXT | None |
BUZEI | TEXT | None |
ANLN1 | NUMBER | None |
ANLN2 | NUMBER | None |
AUFNR | NUMBER | None |
AUGBL | NUMBER | None |
AUGDT | NUMBER | None |
EBELN | NUMBER | None |
EBELP | NUMBER | None |
ETEN2 | NUMBER | None |
FILKD | NUMBER | None |
GSBER | NUMBER | None |
KOART | TEXT | None |
KOSTL | NUMBER | None |
MABER | NUMBER | None |
MADAT | NUMBER | None |
MANSP | NUMBER | None |
MANST | NUMBER | None |
MSCHL | NUMBER | None |
MWSKZ | NUMBER | None |
POSN2 | NUMBER | None |
QBSHB | NUMBER | None |
QSFBT | NUMBER | None |
QSSHB | NUMBER | None |
REBZG | NUMBER | None |
SAMNR | NUMBER | None |
SGTXT | TEXT | None |
SHKZG | TEXT | None |
SKFBT | NUMBER | None |
WSKTO | NUMBER | None |
SKNTO | NUMBER | None |
UMSKS | NUMBER | None |
UMSKZ | NUMBER | None |
UZAWE | NUMBER | None |
VALUT | NUMBER | None |
VBEL2 | NUMBER | None |
VBELN | NUMBER | None |
VBEWA | NUMBER | None |
VBUND | NUMBER | None |
VERTN | NUMBER | None |
VERTT | NUMBER | None |
WERKS | NUMBER | None |
WVERW | NUMBER | None |
XZAHL | TEXT | None |
ZBD1P | NUMBER | None |
ZBD1T | NUMBER | None |
ZBD2P | NUMBER | None |
ZBD2T | NUMBER | None |
ZBD3T | NUMBER | None |
ZFBDT | NUMBER | None |
ZLSCH | NUMBER | None |
ZLSPR | NUMBER | None |
ZTERM | NUMBER | None |
ZUONR | NUMBER | None |
XREF1 | NUMBER | None |
XREF2 | NUMBER | None |
RSTGR | NUMBER | None |
REBZT | NUMBER | None |
PSWSL | TEXT | None |
PSWBT | NUMBER | None |
HKONT | NUMBER | None |
XNEGP | NUMBER | None |
ZBFIX | NUMBER | None |
RFZEI | NUMBER | None |
CCBTC | NUMBER | None |
KKBER | NUMBER | None |
XREF3 | NUMBER | None |
DTWS1 | NUMBER | None |
DTWS2 | NUMBER | None |
DTWS3 | NUMBER | None |
DTWS4 | NUMBER | None |
ABSBT | NUMBER | None |
PROJK | NUMBER | None |
XPYPR | NUMBER | None |
KIDNO | NUMBER | None |
BUPLA | NUMBER | None |
SECCO | NUMBER | None |
PYCUR | NUMBER | None |
PYAMT | NUMBER | None |
XRAGL | NUMBER | None |
CESSION_KZ | NUMBER | None |
BUZID | NUMBER | None |
AUGGJ | NUMBER | None |
AGZEI | NUMBER | None |
BDIFF | NUMBER | None |
BDIF2 | NUMBER | None |
BDIF3 | NUMBER | None |
BEWAR | NUMBER | None |
DABRZ | NUMBER | None |
DMBTR | NUMBER | None |
FKBER | NUMBER | None |
FKBER_LONG | NUMBER | None |
IMKEY | NUMBER | None |
KSTAR | NUMBER | None |
KUNNR | NUMBER | None |
LIFNR | NUMBER | None |
MEINS | NUMBER | None |
MENGE | NUMBER | None |
PARGB | NUMBER | None |
PFKBER | NUMBER | None |
PPRCT | NUMBER | None |
SAKNR | NUMBER | None |
WRBTR | NUMBER | None |
XOPVW | NUMBER | None |
XLGCLR | NUMBER | None |
ZZSPREG | NUMBER | None |
ZZBUSPARTN | NUMBER | None |
ZZPRODUCT | NUMBER | None |
ZZLOCA | NUMBER | None |
ZZCHAN | NUMBER | None |
ZZLOB | NUMBER | None |
ZZUSERFLD1 | NUMBER | None |
ZZUSERFLD2 | NUMBER | None |
ZZUSERFLD3 | NUMBER | None |
ZZREGION | NUMBER | None |
ZZSTATE | NUMBER | None |
This SQL query selects all columns and rows from the 'bseg' table in the 'sap' schema of the 'TEST' database. It's a straightforward SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.bseg
Name | Type | Comment |
---|---|---|
BELNR | NUMBER | None |
BUKRS | NUMBER | None |
BUZEI | NUMBER | None |
GJAHR | NUMBER | None |
MANDT | NUMBER | None |
BUZID | NUMBER | None |
AUGDT | NUMBER | None |
AUGCP | NUMBER | None |
AUGBL | NUMBER | None |
BSCHL | NUMBER | None |
KOART | TEXT | None |
UMSKZ | NUMBER | None |
UMSKS | NUMBER | None |
ZUMSK | NUMBER | None |
SHKZG | TEXT | None |
GSBER | NUMBER | None |
PARGB | NUMBER | None |
MWSKZ | NUMBER | None |
QSSKZ | NUMBER | None |
DMBTR | NUMBER | None |
WRBTR | NUMBER | None |
KZBTR | NUMBER | None |
PSWBT | NUMBER | None |
PSWSL | TEXT | None |
TXBHW | NUMBER | None |
TXBFW | NUMBER | None |
MWSTS | NUMBER | None |
WMWST | NUMBER | None |
HWBAS | NUMBER | None |
FWBAS | NUMBER | None |
HWZUZ | NUMBER | None |
FWZUZ | NUMBER | None |
SHZUZ | NUMBER | None |
STEKZ | NUMBER | None |
MWART | NUMBER | None |
TXGRP | NUMBER | None |
KTOSL | NUMBER | None |
QSSHB | NUMBER | None |
KURSR | NUMBER | None |
GBETR | NUMBER | None |
BDIFF | NUMBER | None |
BDIF2 | NUMBER | None |
VALUT | NUMBER | None |
ZUONR | NUMBER | None |
SGTXT | TEXT | None |
ZINKZ | NUMBER | None |
VBUND | NUMBER | None |
BEWAR | NUMBER | None |
ALTKT | NUMBER | None |
VORGN | TEXT | None |
FDLEV | NUMBER | None |
FDGRP | NUMBER | None |
FDWBT | NUMBER | None |
FDTAG | NUMBER | None |
FKONT | NUMBER | None |
KOKRS | NUMBER | None |
KOSTL | NUMBER | None |
PROJN | NUMBER | None |
AUFNR | NUMBER | None |
VBELN | NUMBER | None |
VBEL2 | NUMBER | None |
POSN2 | NUMBER | None |
ETEN2 | NUMBER | None |
ANLN1 | NUMBER | None |
ANLN2 | NUMBER | None |
ANBWA | NUMBER | None |
BZDAT | NUMBER | None |
PERNR | NUMBER | None |
XUMSW | NUMBER | None |
XHRES | NUMBER | None |
XKRES | TEXT | None |
XOPVW | NUMBER | None |
XCPDD | NUMBER | None |
XSKST | NUMBER | None |
XSAUF | NUMBER | None |
XSPRO | NUMBER | None |
XSERG | NUMBER | None |
XFAKT | NUMBER | None |
XUMAN | NUMBER | None |
XANET | NUMBER | None |
XSKRL | NUMBER | None |
XINVE | NUMBER | None |
XPANZ | NUMBER | None |
XAUTO | NUMBER | None |
XNCOP | NUMBER | None |
XZAHL | TEXT | None |
SAKNR | NUMBER | None |
HKONT | NUMBER | None |
KUNNR | NUMBER | None |
LIFNR | NUMBER | None |
FILKD | NUMBER | None |
XBILK | NUMBER | None |
GVTYP | TEXT | None |
HZUON | NUMBER | None |
ZFBDT | NUMBER | None |
ZTERM | NUMBER | None |
ZBD1T | NUMBER | None |
ZBD2T | NUMBER | None |
ZBD3T | NUMBER | None |
ZBD1P | NUMBER | None |
ZBD2P | NUMBER | None |
SKFBT | NUMBER | None |
SKNTO | NUMBER | None |
WSKTO | NUMBER | None |
ZLSCH | NUMBER | None |
ZLSPR | NUMBER | None |
ZBFIX | NUMBER | None |
HBKID | NUMBER | None |
BVTYP | NUMBER | None |
NEBTR | NUMBER | None |
MWSK1 | NUMBER | None |
DMBT1 | NUMBER | None |
WRBT1 | NUMBER | None |
MWSK2 | NUMBER | None |
DMBT2 | NUMBER | None |
WRBT2 | NUMBER | None |
MWSK3 | NUMBER | None |
DMBT3 | NUMBER | None |
WRBT3 | NUMBER | None |
REBZG | NUMBER | None |
REBZJ | NUMBER | None |
REBZZ | NUMBER | None |
REBZT | NUMBER | None |
ZOLLT | NUMBER | None |
ZOLLD | NUMBER | None |
LZBKZ | NUMBER | None |
LANDL | NUMBER | None |
DIEKZ | NUMBER | None |
SAMNR | NUMBER | None |
ABPER | NUMBER | None |
VRSKZ | NUMBER | None |
VRSDT | NUMBER | None |
DISBN | NUMBER | None |
DISBJ | NUMBER | None |
DISBZ | NUMBER | None |
WVERW | NUMBER | None |
ANFBN | NUMBER | None |
ANFBJ | NUMBER | None |
ANFBU | NUMBER | None |
ANFAE | NUMBER | None |
BLNBT | NUMBER | None |
BLNKZ | NUMBER | None |
BLNPZ | NUMBER | None |
MSCHL | NUMBER | None |
MANSP | NUMBER | None |
MADAT | NUMBER | None |
MANST | NUMBER | None |
MABER | NUMBER | None |
ESRNR | NUMBER | None |
ESRRE | NUMBER | None |
ESRPZ | NUMBER | None |
KLIBT | NUMBER | None |
QSZNR | NUMBER | None |
QBSHB | NUMBER | None |
QSFBT | NUMBER | None |
NAVHW | NUMBER | None |
NAVFW | NUMBER | None |
MATNR | NUMBER | None |
WERKS | NUMBER | None |
MENGE | NUMBER | None |
MEINS | NUMBER | None |
ERFMG | NUMBER | None |
ERFME | NUMBER | None |
BPMNG | NUMBER | None |
BPRME | NUMBER | None |
EBELN | NUMBER | None |
EBELP | NUMBER | None |
ZEKKN | NUMBER | None |
ELIKZ | NUMBER | None |
VPRSV | NUMBER | None |
PEINH | NUMBER | None |
BWKEY | NUMBER | None |
BWTAR | NUMBER | None |
BUSTW | NUMBER | None |
REWRT | NUMBER | None |
REWWR | NUMBER | None |
BONFB | NUMBER | None |
BUALT | NUMBER | None |
PSALT | NUMBER | None |
NPREI | NUMBER | None |
TBTKZ | NUMBER | None |
SPGRP | NUMBER | None |
SPGRM | NUMBER | None |
SPGRT | NUMBER | None |
SPGRG | NUMBER | None |
SPGRV | NUMBER | None |
SPGRQ | NUMBER | None |
STCEG | NUMBER | None |
EGBLD | NUMBER | None |
EGLLD | NUMBER | None |
RSTGR | NUMBER | None |
RYACQ | NUMBER | None |
RPACQ | NUMBER | None |
RDIFF | NUMBER | None |
RDIF2 | NUMBER | None |
PRCTR | NUMBER | None |
XHKOM | NUMBER | None |
VNAME | NUMBER | None |
RECID | NUMBER | None |
EGRUP | NUMBER | None |
VPTNR | NUMBER | None |
VERTT | NUMBER | None |
VERTN | NUMBER | None |
VBEWA | NUMBER | None |
DEPOT | NUMBER | None |
TXJCD | NUMBER | None |
IMKEY | NUMBER | None |
DABRZ | NUMBER | None |
POPTS | NUMBER | None |
FIPOS | NUMBER | None |
KSTRG | NUMBER | None |
NPLNR | NUMBER | None |
AUFPL | NUMBER | None |
APLZL | NUMBER | None |
PROJK | NUMBER | None |
PAOBJNR | NUMBER | None |
PASUBNR | NUMBER | None |
SPGRS | NUMBER | None |
SPGRC | NUMBER | None |
BTYPE | NUMBER | None |
ETYPE | NUMBER | None |
XEGDR | NUMBER | None |
LNRAN | NUMBER | None |
HRKFT | NUMBER | None |
DMBE2 | NUMBER | None |
DMBE3 | NUMBER | None |
DMB21 | NUMBER | None |
DMB22 | NUMBER | None |
DMB23 | NUMBER | None |
DMB31 | NUMBER | None |
DMB32 | NUMBER | None |
DMB33 | NUMBER | None |
MWST2 | NUMBER | None |
MWST3 | NUMBER | None |
NAVH2 | NUMBER | None |
NAVH3 | NUMBER | None |
SKNT2 | NUMBER | None |
SKNT3 | NUMBER | None |
BDIF3 | NUMBER | None |
RDIF3 | NUMBER | None |
HWMET | NUMBER | None |
GLUPM | NUMBER | None |
XRAGL | NUMBER | None |
UZAWE | NUMBER | None |
LOKKT | NUMBER | None |
FISTL | NUMBER | None |
GEBER | NUMBER | None |
STBUK | NUMBER | None |
TXBH2 | NUMBER | None |
TXBH3 | NUMBER | None |
PPRCT | NUMBER | None |
XREF1 | NUMBER | None |
XREF2 | NUMBER | None |
KBLNR | NUMBER | None |
KBLPOS | NUMBER | None |
STTAX | NUMBER | None |
FKBER | NUMBER | None |
OBZEI | NUMBER | None |
XNEGP | NUMBER | None |
RFZEI | NUMBER | None |
CCBTC | NUMBER | None |
KKBER | NUMBER | None |
EMPFB | NUMBER | None |
XREF3 | NUMBER | None |
DTWS1 | NUMBER | None |
DTWS2 | NUMBER | None |
DTWS3 | NUMBER | None |
DTWS4 | NUMBER | None |
GRICD | NUMBER | None |
GRIRG | NUMBER | None |
GITYP | NUMBER | None |
XPYPR | NUMBER | None |
KIDNO | NUMBER | None |
ABSBT | NUMBER | None |
IDXSP | NUMBER | None |
LINFV | NUMBER | None |
KONTT | NUMBER | None |
KONTL | NUMBER | None |
TXDAT | NUMBER | None |
AGZEI | NUMBER | None |
PYCUR | NUMBER | None |
PYAMT | NUMBER | None |
BUPLA | NUMBER | None |
SECCO | NUMBER | None |
LSTAR | NUMBER | None |
CESSION_KZ | NUMBER | None |
PRZNR | NUMBER | None |
PPDIFF | NUMBER | None |
PPDIF2 | NUMBER | None |
PPDIF3 | NUMBER | None |
PENLC1 | NUMBER | None |
PENLC2 | NUMBER | None |
PENLC3 | NUMBER | None |
PENFC | NUMBER | None |
PENDAYS | NUMBER | None |
PENRC | NUMBER | None |
GRANT_NBR | NUMBER | None |
SCTAX | NUMBER | None |
FKBER_LONG | NUMBER | None |
GMVKZ | NUMBER | None |
SRTYPE | NUMBER | None |
INTRENO | NUMBER | None |
MEASURE | NUMBER | None |
AUGGJ | NUMBER | None |
PPA_EX_IND | NUMBER | None |
DOCLN | NUMBER | None |
SEGMENT | NUMBER | None |
PSEGMENT | NUMBER | None |
PFKBER | NUMBER | None |
HKTID | NUMBER | None |
KSTAR | NUMBER | None |
XLGCLR | NUMBER | None |
TAXPS | NUMBER | None |
PAYS_PROV | NUMBER | None |
PAYS_TRAN | NUMBER | None |
MNDID | NUMBER | None |
XFRGE_BSEG | NUMBER | None |
SQUAN | NUMBER | None |
ZZSPREG | NUMBER | None |
ZZBUSPARTN | NUMBER | None |
ZZCHAN | NUMBER | None |
ZZPRODUCT | NUMBER | None |
ZZLOCA | NUMBER | None |
ZZLOB | NUMBER | None |
ZZUSERFLD1 | NUMBER | None |
ZZUSERFLD2 | NUMBER | None |
ZZUSERFLD3 | NUMBER | None |
ZZSTATE | NUMBER | None |
ZZREGION | NUMBER | None |
RE_BUKRS | NUMBER | None |
RE_ACCOUNT | NUMBER | None |
PGEBER | NUMBER | None |
PGRANT_NBR | NUMBER | None |
BUDGET_PD | NUMBER | None |
PBUDGET_PD | NUMBER | None |
J_1TPBUPL | NUMBER | None |
PEROP_BEG | NUMBER | None |
PEROP_END | NUMBER | None |
FASTPAY | NUMBER | None |
IGNR_IVREF | NUMBER | None |
FMFGUS_KEY | NUMBER | None |
FMXDOCNR | NUMBER | None |
FMXYEAR | NUMBER | None |
FMXDOCLN | NUMBER | None |
FMXZEKKN | NUMBER | None |
PRODPER | NUMBER | None |
RECRF | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query is primarily focused on cleaning and transforming data from a staging table (TEST.PUBLIC_stg_sap.stg_sap__faglflexa_tmp). It defines specific data types for each column, casts certain columns to ensure proper data types, and selects a subset of columns for the final output. The query doesn't perform any filtering, deduplication, featurization, integration, or aggregation.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__faglflexa_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS activ,
CAST(NULL AS TEXT) AS awtyp,
CAST(NULL AS TEXT) AS belnr,
CAST(NULL AS TEXT) AS bschl,
CAST(NULL AS TEXT) AS bstat,
CAST(NULL AS TEXT) AS budat,
CAST(NULL AS TEXT) AS buzei,
CAST(NULL AS TEXT) AS cost_elem,
CAST(NULL AS TEXT) AS docln,
CAST(NULL AS TEXT) AS docnr,
CAST(NULL AS TEXT) AS drcrk,
CAST(NULL AS TEXT) AS gjahr,
CAST(NULL AS DECIMAL(28, 6)) AS hsl,
CAST(NULL AS TEXT) AS kokrs,
CAST(NULL AS DECIMAL(28, 6)) AS ksl,
CAST(NULL AS TEXT) AS linetype,
CAST(NULL AS TEXT) AS logsys,
CAST(NULL AS DECIMAL(28, 6)) AS msl,
CAST(NULL AS DECIMAL(28, 6)) AS osl,
CAST(NULL AS TEXT) AS poper,
CAST(NULL AS TEXT) AS pprctr,
CAST(NULL AS TEXT) AS prctr,
CAST(NULL AS TEXT) AS psegment,
CAST(NULL AS TEXT) AS racct,
CAST(NULL AS TEXT) AS rassc,
CAST(NULL AS TEXT) AS rbukrs,
CAST(NULL AS TEXT) AS rbusa,
CAST(NULL AS TEXT) AS rclnt,
CAST(NULL AS TEXT) AS rcntr,
CAST(NULL AS TEXT) AS rfarea,
CAST(NULL AS TEXT) AS rldnr,
CAST(NULL AS TEXT) AS rmvct,
CAST(NULL AS TEXT) AS rrcty,
CAST(NULL AS TEXT) AS rtcur,
CAST(NULL AS TEXT) AS runit,
CAST(NULL AS TEXT) AS rvers,
CAST(NULL AS TEXT) AS rwcur,
CAST(NULL AS TEXT) AS ryear,
CAST(NULL AS TEXT) AS sbusa,
CAST(NULL AS TEXT) AS scntr,
CAST(NULL AS TEXT) AS segment,
CAST(NULL AS TEXT) AS sfarea,
CAST(NULL AS DECIMAL(28, 6)) AS faglflexa_timestamp,
CAST(NULL AS DECIMAL(28, 6)) AS tsl,
CAST(NULL AS TEXT) AS usnam,
CAST(NULL AS DECIMAL(28, 6)) AS wsl,
CAST(NULL AS TEXT) AS xsplitmod,
CAST(NULL AS TEXT) AS zzspreg
FROM base
), final AS (
SELECT
CAST(rclnt AS TEXT) AS rclnt,
ryear,
docnr,
CAST(rldnr AS TEXT) AS rldnr,
CAST(rbukrs AS TEXT) AS rbukrs,
docln,
activ,
rmvct,
rtcur,
runit,
awtyp,
rrcty,
rvers,
logsys,
racct,
cost_elem,
rcntr,
prctr,
rfarea,
rbusa,
kokrs,
segment,
scntr,
pprctr,
sfarea,
sbusa,
rassc,
psegment,
tsl,
hsl,
ksl,
osl,
msl,
wsl,
drcrk,
poper,
rwcur,
CAST(gjahr AS TEXT) AS gjahr,
budat,
CAST(belnr AS TEXT) AS belnr,
CAST(buzei AS TEXT) AS buzei,
bschl,
bstat,
faglflexa_timestamp,
_fivetran_synced
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
ryear | None | Fiscal year |
docnr | None | Accounting document number |
rldnr | None | Ledger in genral ledger accounting |
rbukrs | None | Company code |
docln | None | Six-character posting item for ledger |
activ | None | FI-SL business transaction |
rmvct | None | Transaction type |
rtcur | None | Currency key |
runit | None | Base unit of measure |
awtyp | None | Reference transaction |
rrcty | None | Record type |
rvers | None | Version |
logsys | None | Logical system |
racct | None | Account number |
cost_elem | None | Cost element |
rclnt | None | Client |
rcntr | None | Cost center |
prctr | None | Profit center |
rfarea | None | Functional area |
rbusa | None | Business area |
kokrs | None | Controlling area |
segment | None | Segment for segmental reporting |
scntr | None | Sender cost center |
pprctr | None | Partner profit center |
sfarea | None | Partner functional area |
sbusa | None | Trading partner's business area |
rassc | None | Company id of trading partner |
psegment | None | Partner segment for segmental reporting |
tsl | None | Value in transaction currency |
hsl | None | Value in local currency |
ksl | None | Value in group currency |
osl | None | Value in another currency |
msl | None | Quantity |
wsl | None | Value in original transaction currency |
drcrk | None | Debt/credit indicator |
poper | None | Posting period |
rwcur | None | Currency key of the original transaction currency |
gjahr | None | Fiscal year |
budat | None | Posting date in the document |
belnr | None | Accounting document number |
buzei | None | Number of line item within accounting document |
bschl | None | Posting key |
bstat | None | Document status |
faglflexa_timestamp | None | UTC Timestamp in short form (YYYYMMDDhhmmss) |
RCLNT | TEXT | None |
RYEAR | NUMBER | None |
DOCNR | TEXT | None |
RLDNR | TEXT | None |
RBUKRS | TEXT | None |
DOCLN | TEXT | None |
ACTIV | TEXT | None |
RMVCT | NUMBER | None |
RTCUR | TEXT | None |
RUNIT | NUMBER | None |
AWTYP | TEXT | None |
RRCTY | NUMBER | None |
RVERS | NUMBER | None |
LOGSYS | NUMBER | None |
RACCT | TEXT | None |
COST_ELEM | NUMBER | None |
RCNTR | NUMBER | None |
PRCTR | NUMBER | None |
RFAREA | NUMBER | None |
RBUSA | NUMBER | None |
KOKRS | NUMBER | None |
SEGMENT | NUMBER | None |
SCNTR | NUMBER | None |
PPRCTR | NUMBER | None |
SFAREA | NUMBER | None |
SBUSA | NUMBER | None |
RASSC | NUMBER | None |
PSEGMENT | NUMBER | None |
TSL | NUMBER | None |
HSL | NUMBER | None |
KSL | NUMBER | None |
OSL | NUMBER | None |
MSL | NUMBER | None |
WSL | NUMBER | None |
DRCRK | TEXT | None |
POPER | NUMBER | None |
RWCUR | TEXT | None |
GJAHR | TEXT | None |
BUDAT | TEXT | None |
BELNR | TEXT | None |
BUZEI | TEXT | None |
BSCHL | NUMBER | None |
BSTAT | NUMBER | None |
FAGLFLEXA_TIMESTAMP | NUMBER | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query selects all columns and rows from the 'faglflexa' table in the 'sap' schema of the 'TEST' database. It is a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.faglflexa
Name | Type | Comment |
---|---|---|
DOCLN | TEXT | None |
DOCNR | TEXT | None |
RBUKRS | NUMBER | None |
RCLNT | NUMBER | None |
RLDNR | TEXT | None |
RYEAR | NUMBER | None |
ACTIV | TEXT | None |
RMVCT | NUMBER | None |
RTCUR | TEXT | None |
RUNIT | NUMBER | None |
AWTYP | TEXT | None |
RRCTY | NUMBER | None |
RVERS | NUMBER | None |
LOGSYS | NUMBER | None |
RACCT | TEXT | None |
COST_ELEM | NUMBER | None |
RCNTR | NUMBER | None |
PRCTR | NUMBER | None |
RFAREA | NUMBER | None |
RBUSA | NUMBER | None |
KOKRS | NUMBER | None |
SEGMENT | NUMBER | None |
ZZSPREG | NUMBER | None |
SCNTR | NUMBER | None |
PPRCTR | NUMBER | None |
SFAREA | NUMBER | None |
SBUSA | NUMBER | None |
RASSC | NUMBER | None |
PSEGMENT | NUMBER | None |
TSL | NUMBER | None |
HSL | NUMBER | None |
KSL | NUMBER | None |
OSL | NUMBER | None |
MSL | NUMBER | None |
WSL | NUMBER | None |
DRCRK | TEXT | None |
POPER | NUMBER | None |
RWCUR | TEXT | None |
GJAHR | NUMBER | None |
BUDAT | TEXT | None |
BELNR | TEXT | None |
BUZEI | NUMBER | None |
BSCHL | NUMBER | None |
BSTAT | NUMBER | None |
LINETYPE | NUMBER | None |
XSPLITMOD | NUMBER | None |
USNAM | TEXT | None |
TIMESTAMP | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query is primarily focused on data type casting and column selection. It starts by selecting all columns from a temporary table, then defines a set of fields with specific data types (mostly converting to TEXT or DECIMAL). Finally, it selects and rearranges these fields into a final output, applying some additional CAST operations to certain columns. The query doesn't perform any filtering, aggregation, or complex transformations.
CleaningOtherWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__faglflext_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS activ,
CAST(NULL AS TEXT) AS awtyp,
CAST(NULL AS TEXT) AS cost_elem,
CAST(NULL AS TEXT) AS drcrk,
CAST(NULL AS DECIMAL(28, 6)) AS hsl01,
CAST(NULL AS DECIMAL(28, 6)) AS hsl02,
CAST(NULL AS DECIMAL(28, 6)) AS hsl03,
CAST(NULL AS DECIMAL(28, 6)) AS hsl04,
CAST(NULL AS DECIMAL(28, 6)) AS hsl05,
CAST(NULL AS DECIMAL(28, 6)) AS hsl06,
CAST(NULL AS DECIMAL(28, 6)) AS hsl07,
CAST(NULL AS DECIMAL(28, 6)) AS hsl08,
CAST(NULL AS DECIMAL(28, 6)) AS hsl09,
CAST(NULL AS DECIMAL(28, 6)) AS hsl10,
CAST(NULL AS DECIMAL(28, 6)) AS hsl11,
CAST(NULL AS DECIMAL(28, 6)) AS hsl12,
CAST(NULL AS DECIMAL(28, 6)) AS hsl13,
CAST(NULL AS DECIMAL(28, 6)) AS hsl14,
CAST(NULL AS DECIMAL(28, 6)) AS hsl15,
CAST(NULL AS DECIMAL(28, 6)) AS hsl16,
CAST(NULL AS DECIMAL(28, 6)) AS hslvt,
CAST(NULL AS TEXT) AS kokrs,
CAST(NULL AS DECIMAL(28, 6)) AS ksl01,
CAST(NULL AS DECIMAL(28, 6)) AS ksl02,
CAST(NULL AS DECIMAL(28, 6)) AS ksl03,
CAST(NULL AS DECIMAL(28, 6)) AS ksl04,
CAST(NULL AS DECIMAL(28, 6)) AS ksl05,
CAST(NULL AS DECIMAL(28, 6)) AS ksl06,
CAST(NULL AS DECIMAL(28, 6)) AS ksl07,
CAST(NULL AS DECIMAL(28, 6)) AS ksl08,
CAST(NULL AS DECIMAL(28, 6)) AS ksl09,
CAST(NULL AS DECIMAL(28, 6)) AS ksl10,
CAST(NULL AS DECIMAL(28, 6)) AS ksl11,
CAST(NULL AS DECIMAL(28, 6)) AS ksl12,
CAST(NULL AS DECIMAL(28, 6)) AS ksl13,
CAST(NULL AS DECIMAL(28, 6)) AS ksl14,
CAST(NULL AS DECIMAL(28, 6)) AS ksl15,
CAST(NULL AS DECIMAL(28, 6)) AS ksl16,
CAST(NULL AS DECIMAL(28, 6)) AS kslvt,
CAST(NULL AS TEXT) AS logsys,
CAST(NULL AS DECIMAL(28, 6)) AS msl01,
CAST(NULL AS DECIMAL(28, 6)) AS msl02,
CAST(NULL AS DECIMAL(28, 6)) AS msl03,
CAST(NULL AS DECIMAL(28, 6)) AS msl04,
CAST(NULL AS DECIMAL(28, 6)) AS msl05,
CAST(NULL AS DECIMAL(28, 6)) AS msl06,
CAST(NULL AS DECIMAL(28, 6)) AS msl07,
CAST(NULL AS DECIMAL(28, 6)) AS msl08,
CAST(NULL AS DECIMAL(28, 6)) AS msl09,
CAST(NULL AS DECIMAL(28, 6)) AS msl10,
CAST(NULL AS DECIMAL(28, 6)) AS msl11,
CAST(NULL AS DECIMAL(28, 6)) AS msl12,
CAST(NULL AS DECIMAL(28, 6)) AS msl13,
CAST(NULL AS DECIMAL(28, 6)) AS msl14,
CAST(NULL AS DECIMAL(28, 6)) AS msl15,
CAST(NULL AS DECIMAL(28, 6)) AS msl16,
CAST(NULL AS DECIMAL(28, 6)) AS mslvt,
CAST(NULL AS DECIMAL(28, 6)) AS objnr00,
CAST(NULL AS DECIMAL(28, 6)) AS objnr01,
CAST(NULL AS DECIMAL(28, 6)) AS objnr02,
CAST(NULL AS DECIMAL(28, 6)) AS objnr03,
CAST(NULL AS DECIMAL(28, 6)) AS objnr04,
CAST(NULL AS DECIMAL(28, 6)) AS objnr05,
CAST(NULL AS DECIMAL(28, 6)) AS objnr06,
CAST(NULL AS DECIMAL(28, 6)) AS objnr07,
CAST(NULL AS DECIMAL(28, 6)) AS objnr08,
CAST(NULL AS DECIMAL(28, 6)) AS osl01,
CAST(NULL AS DECIMAL(28, 6)) AS osl02,
CAST(NULL AS DECIMAL(28, 6)) AS osl03,
CAST(NULL AS DECIMAL(28, 6)) AS osl04,
CAST(NULL AS DECIMAL(28, 6)) AS osl05,
CAST(NULL AS DECIMAL(28, 6)) AS osl06,
CAST(NULL AS DECIMAL(28, 6)) AS osl07,
CAST(NULL AS DECIMAL(28, 6)) AS osl08,
CAST(NULL AS DECIMAL(28, 6)) AS osl09,
CAST(NULL AS DECIMAL(28, 6)) AS osl10,
CAST(NULL AS DECIMAL(28, 6)) AS osl11,
CAST(NULL AS DECIMAL(28, 6)) AS osl12,
CAST(NULL AS DECIMAL(28, 6)) AS osl13,
CAST(NULL AS DECIMAL(28, 6)) AS osl14,
CAST(NULL AS DECIMAL(28, 6)) AS osl15,
CAST(NULL AS DECIMAL(28, 6)) AS osl16,
CAST(NULL AS DECIMAL(28, 6)) AS oslvt,
CAST(NULL AS TEXT) AS pprctr,
CAST(NULL AS TEXT) AS prctr,
CAST(NULL AS TEXT) AS psegment,
CAST(NULL AS TEXT) AS racct,
CAST(NULL AS TEXT) AS rassc,
CAST(NULL AS TEXT) AS rbukrs,
CAST(NULL AS TEXT) AS rbusa,
CAST(NULL AS TEXT) AS rclnt,
CAST(NULL AS TEXT) AS rcntr,
CAST(NULL AS TEXT) AS rfarea,
CAST(NULL AS TEXT) AS rldnr,
CAST(NULL AS TEXT) AS rmvct,
CAST(NULL AS TEXT) AS rpmax,
CAST(NULL AS TEXT) AS rrcty,
CAST(NULL AS TEXT) AS rtcur,
CAST(NULL AS TEXT) AS runit,
CAST(NULL AS TEXT) AS rvers,
CAST(NULL AS TEXT) AS ryear,
CAST(NULL AS TEXT) AS sbusa,
CAST(NULL AS TEXT) AS scntr,
CAST(NULL AS TEXT) AS segment,
CAST(NULL AS TEXT) AS sfarea,
CAST(NULL AS DECIMAL(28, 6)) AS faglflext_timestamp,
CAST(NULL AS DECIMAL(28, 6)) AS tsl01,
CAST(NULL AS DECIMAL(28, 6)) AS tsl02,
CAST(NULL AS DECIMAL(28, 6)) AS tsl03,
CAST(NULL AS DECIMAL(28, 6)) AS tsl04,
CAST(NULL AS DECIMAL(28, 6)) AS tsl05,
CAST(NULL AS DECIMAL(28, 6)) AS tsl06,
CAST(NULL AS DECIMAL(28, 6)) AS tsl07,
CAST(NULL AS DECIMAL(28, 6)) AS tsl08,
CAST(NULL AS DECIMAL(28, 6)) AS tsl09,
CAST(NULL AS DECIMAL(28, 6)) AS tsl10,
CAST(NULL AS DECIMAL(28, 6)) AS tsl11,
CAST(NULL AS DECIMAL(28, 6)) AS tsl12,
CAST(NULL AS DECIMAL(28, 6)) AS tsl13,
CAST(NULL AS DECIMAL(28, 6)) AS tsl14,
CAST(NULL AS DECIMAL(28, 6)) AS tsl15,
CAST(NULL AS DECIMAL(28, 6)) AS tsl16,
CAST(NULL AS DECIMAL(28, 6)) AS tslvt,
CAST(NULL AS TEXT) AS zzspreg
FROM base
), final AS (
SELECT
CAST(rclnt AS TEXT) AS rclnt,
ryear,
objnr00,
objnr01,
objnr02,
objnr03,
objnr04,
objnr05,
objnr06,
objnr07,
objnr08,
drcrk,
rpmax,
activ,
rmvct,
rtcur,
runit,
awtyp,
CAST(rldnr AS TEXT) AS rldnr,
rrcty,
rvers,
logsys,
racct,
cost_elem,
CAST(rbukrs AS TEXT) AS rbukrs,
rcntr,
prctr,
rfarea,
rbusa,
kokrs,
segment,
zzspreg,
scntr,
pprctr,
sfarea,
sbusa,
rassc,
psegment,
hslvt,
hsl01,
hsl02,
hsl03,
hsl04,
hsl05,
hsl06,
hsl07,
hsl08,
hsl09,
hsl10,
hsl11,
hsl12,
hsl13,
hsl14,
hsl15,
hsl16,
tslvt,
tsl01,
tsl02,
tsl03,
tsl04,
tsl05,
tsl06,
tsl07,
tsl08,
tsl09,
tsl10,
tsl11,
tsl12,
tsl13,
tsl14,
tsl15,
tsl16,
kslvt,
ksl01,
ksl02,
ksl03,
ksl04,
ksl05,
ksl06,
ksl07,
ksl08,
ksl09,
ksl10,
ksl11,
ksl12,
ksl13,
ksl14,
ksl15,
ksl16,
oslvt,
osl01,
osl02,
osl03,
osl04,
osl05,
osl06,
osl07,
osl08,
osl09,
osl10,
osl11,
osl12,
osl13,
osl14,
osl15,
osl16,
faglflext_timestamp,
_fivetran_rowid,
_fivetran_deleted,
_fivetran_synced
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
drcrk | None | Debit/credit indicator |
objnr00 | None | Object number for table group |
objnr01 | None | Object number for table group |
objnr02 | None | Object number for table group |
objnr03 | None | Object number for table group |
objnr04 | None | Object number for table group |
objnr05 | None | Object number for table group |
objnr06 | None | Object number for table group |
objnr07 | None | Object number for table group |
objnr08 | None | Object number for table group |
rclnt | None | Client |
rpmax | None | Period |
ryear | None | Fiscal year |
activ | None | FI-SL business transaction |
rmvct | None | Transaction type |
rtcur | None | Currency key |
runit | None | Base unit of measure |
awtyp | None | Reference transaction |
rldnr | None | Ledger in general ledger accounting |
rrcty | None | Record type |
rvers | None | Version |
logsys | None | Logical system |
racct | None | Account number |
cost_elem | None | Cost element |
rbukrs | None | Company code |
rcntr | None | Cost center |
prctr | None | Profit center |
rfarea | None | Functional area |
rbusa | None | Business area |
kokrs | None | Controlling area |
segment | None | Segment for segmental reporting |
zzspreg | None | Special region |
scntr | None | None |
pprctr | None | Partner profit center |
sfarea | None | Partner functional area |
sbusa | None | Trading partner's business area |
rassc | None | Company id of trading partner |
psegment | None | Partner segment for segmental reporting |
hslvt | None | Balance carried forward in local currency |
hsl01 | None | Total of transactions of the period in local currency |
hsl02 | None | Total of transactions of the period in local currency |
hsl03 | None | Total of transactions of the period in local currency |
hsl04 | None | Total of transactions of the period in local currency |
hsl05 | None | Total of transactions of the period in local currency |
hsl06 | None | Total of transactions of the period in local currency |
hsl07 | None | Total of transactions of the period in local currency |
hsl08 | None | Total of transactions of the period in local currency |
hsl09 | None | Total of transactions of the period in local currency |
hsl10 | None | Total of transactions of the period in local currency |
hsl11 | None | Total of transactions of the period in local currency |
hsl12 | None | Total of transactions of the period in local currency |
hsl13 | None | Total of transactions of the period in local currency |
hsl14 | None | Total of transactions of the period in local currency |
hsl15 | None | Total of transactions of the period in local currency |
hsl16 | None | Total of transactions of the period in local currency |
tslvt | None | Balance carried forward in transaction currency |
tsl01 | None | Total of transactions of the period in transaction currency |
tsl02 | None | Total of transactions of the period in transaction currency |
tsl03 | None | Total of transactions of the period in transaction currency |
tsl04 | None | Total of transactions of the period in transaction currency |
tsl05 | None | Total of transactions of the period in transaction currency |
tsl06 | None | Total of transactions of the period in transaction currency |
tsl07 | None | Total of transactions of the period in transaction currency |
tsl08 | None | Total of transactions of the period in transaction currency |
tsl09 | None | Total of transactions of the period in transaction currency |
tsl10 | None | Total of transactions of the period in transaction currency |
tsl11 | None | Total of transactions of the period in transaction currency |
tsl12 | None | Total of transactions of the period in transaction currency |
tsl13 | None | Total of transactions of the period in transaction currency |
tsl14 | None | Total of transactions of the period in transaction currency |
tsl15 | None | Total of transactions of the period in transaction currency |
tsl16 | None | Total of transactions of the period in transaction currency |
kslvt | None | Balance carried forward in group currency |
ksl01 | None | Total of transactions of the period in group currency |
ksl02 | None | Total of transactions of the period in group currency |
ksl03 | None | Total of transactions of the period in group currency |
ksl04 | None | Total of transactions of the period in group currency |
ksl05 | None | Total of transactions of the period in group currency |
ksl06 | None | Total of transactions of the period in group currency |
ksl07 | None | Total of transactions of the period in group currency |
ksl08 | None | Total of transactions of the period in group currency |
ksl09 | None | Total of transactions of the period in group currency |
ksl10 | None | Total of transactions of the period in group currency |
ksl11 | None | Total of transactions of the period in group currency |
ksl12 | None | Total of transactions of the period in group currency |
ksl13 | None | Total of transactions of the period in group currency |
ksl14 | None | Total of transactions of the period in group currency |
ksl15 | None | Total of transactions of the period in group currency |
ksl16 | None | Total of transactions of the period in group currency |
oslvt | None | Balance carried forward in fourth currency |
osl01 | None | Total transactions for the period in the fourth currency |
osl02 | None | Total transactions for the period in the fourth currency |
osl03 | None | Total transactions for the period in the fourth currency |
osl04 | None | Total transactions for the period in the fourth currency |
osl05 | None | Total transactions for the period in the fourth currency |
osl06 | None | Total transactions for the period in the fourth currency |
osl07 | None | Total transactions for the period in the fourth currency |
osl08 | None | Total transactions for the period in the fourth currency |
osl09 | None | Total transactions for the period in the fourth currency |
osl10 | None | Total transactions for the period in the fourth currency |
osl11 | None | Total transactions for the period in the fourth currency |
osl12 | None | Total transactions for the period in the fourth currency |
osl13 | None | Total transactions for the period in the fourth currency |
osl14 | None | Total transactions for the period in the fourth currency |
osl15 | None | Total transactions for the period in the fourth currency |
osl16 | None | Total transactions for the period in the fourth currency |
faglflext_timestamp | None | UTC timestamp in short form (YYYYMMDDhhmmss) |
RCLNT | TEXT | None |
RYEAR | NUMBER | None |
OBJNR00 | NUMBER | None |
OBJNR01 | NUMBER | None |
OBJNR02 | NUMBER | None |
OBJNR03 | NUMBER | None |
OBJNR04 | NUMBER | None |
OBJNR05 | NUMBER | None |
OBJNR06 | NUMBER | None |
OBJNR07 | NUMBER | None |
OBJNR08 | NUMBER | None |
DRCRK | TEXT | None |
RPMAX | NUMBER | None |
ACTIV | TEXT | None |
RMVCT | NUMBER | None |
RTCUR | TEXT | None |
RUNIT | NUMBER | None |
AWTYP | TEXT | None |
RLDNR | TEXT | None |
RRCTY | NUMBER | None |
RVERS | NUMBER | None |
LOGSYS | NUMBER | None |
RACCT | TEXT | None |
COST_ELEM | NUMBER | None |
RBUKRS | TEXT | None |
RCNTR | NUMBER | None |
PRCTR | NUMBER | None |
RFAREA | NUMBER | None |
RBUSA | NUMBER | None |
KOKRS | NUMBER | None |
SEGMENT | NUMBER | None |
ZZSPREG | NUMBER | None |
SCNTR | NUMBER | None |
PPRCTR | NUMBER | None |
SFAREA | NUMBER | None |
SBUSA | NUMBER | None |
RASSC | NUMBER | None |
PSEGMENT | NUMBER | None |
HSLVT | NUMBER | None |
HSL01 | NUMBER | None |
HSL02 | NUMBER | None |
HSL03 | NUMBER | None |
HSL04 | NUMBER | None |
HSL05 | NUMBER | None |
HSL06 | NUMBER | None |
HSL07 | NUMBER | None |
HSL08 | NUMBER | None |
HSL09 | NUMBER | None |
HSL10 | NUMBER | None |
HSL11 | NUMBER | None |
HSL12 | NUMBER | None |
HSL13 | NUMBER | None |
HSL14 | NUMBER | None |
HSL15 | NUMBER | None |
HSL16 | NUMBER | None |
TSLVT | NUMBER | None |
TSL01 | NUMBER | None |
TSL02 | NUMBER | None |
TSL03 | NUMBER | None |
TSL04 | NUMBER | None |
TSL05 | NUMBER | None |
TSL06 | NUMBER | None |
TSL07 | NUMBER | None |
TSL08 | NUMBER | None |
TSL09 | NUMBER | None |
TSL10 | NUMBER | None |
TSL11 | NUMBER | None |
TSL12 | NUMBER | None |
TSL13 | NUMBER | None |
TSL14 | NUMBER | None |
TSL15 | NUMBER | None |
TSL16 | NUMBER | None |
KSLVT | NUMBER | None |
KSL01 | NUMBER | None |
KSL02 | NUMBER | None |
KSL03 | NUMBER | None |
KSL04 | NUMBER | None |
KSL05 | NUMBER | None |
KSL06 | NUMBER | None |
KSL07 | NUMBER | None |
KSL08 | NUMBER | None |
KSL09 | NUMBER | None |
KSL10 | NUMBER | None |
KSL11 | NUMBER | None |
KSL12 | NUMBER | None |
KSL13 | NUMBER | None |
KSL14 | NUMBER | None |
KSL15 | NUMBER | None |
KSL16 | NUMBER | None |
OSLVT | NUMBER | None |
OSL01 | NUMBER | None |
OSL02 | NUMBER | None |
OSL03 | NUMBER | None |
OSL04 | NUMBER | None |
OSL05 | NUMBER | None |
OSL06 | NUMBER | None |
OSL07 | NUMBER | None |
OSL08 | NUMBER | None |
OSL09 | NUMBER | None |
OSL10 | NUMBER | None |
OSL11 | NUMBER | None |
OSL12 | NUMBER | None |
OSL13 | NUMBER | None |
OSL14 | NUMBER | None |
OSL15 | NUMBER | None |
OSL16 | NUMBER | None |
FAGLFLEXT_TIMESTAMP | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query selects all columns and rows from the table 'faglflext' in the 'sap' schema of the 'TEST' database. It performs a simple data extraction without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.faglflext
Name | Type | Comment |
---|---|---|
DRCRK | TEXT | None |
OBJNR00 | NUMBER | None |
OBJNR01 | NUMBER | None |
OBJNR02 | NUMBER | None |
OBJNR03 | NUMBER | None |
OBJNR04 | NUMBER | None |
OBJNR05 | NUMBER | None |
OBJNR06 | NUMBER | None |
OBJNR07 | NUMBER | None |
OBJNR08 | NUMBER | None |
RCLNT | NUMBER | None |
RPMAX | NUMBER | None |
RYEAR | NUMBER | None |
ACTIV | TEXT | None |
RMVCT | NUMBER | None |
RTCUR | TEXT | None |
RUNIT | NUMBER | None |
AWTYP | TEXT | None |
RLDNR | TEXT | None |
RRCTY | NUMBER | None |
RVERS | NUMBER | None |
LOGSYS | NUMBER | None |
RACCT | TEXT | None |
COST_ELEM | NUMBER | None |
RBUKRS | NUMBER | None |
RCNTR | NUMBER | None |
PRCTR | NUMBER | None |
RFAREA | NUMBER | None |
RBUSA | NUMBER | None |
KOKRS | NUMBER | None |
SEGMENT | NUMBER | None |
ZZSPREG | NUMBER | None |
SCNTR | NUMBER | None |
PPRCTR | NUMBER | None |
SFAREA | NUMBER | None |
SBUSA | NUMBER | None |
RASSC | NUMBER | None |
PSEGMENT | NUMBER | None |
TSLVT | NUMBER | None |
TSL01 | NUMBER | None |
TSL02 | NUMBER | None |
TSL03 | NUMBER | None |
TSL04 | NUMBER | None |
TSL05 | NUMBER | None |
TSL06 | NUMBER | None |
TSL07 | NUMBER | None |
TSL08 | NUMBER | None |
TSL09 | NUMBER | None |
TSL10 | NUMBER | None |
TSL11 | NUMBER | None |
TSL12 | NUMBER | None |
TSL13 | NUMBER | None |
TSL14 | NUMBER | None |
TSL15 | NUMBER | None |
TSL16 | NUMBER | None |
HSLVT | NUMBER | None |
HSL01 | NUMBER | None |
HSL02 | NUMBER | None |
HSL03 | NUMBER | None |
HSL04 | NUMBER | None |
HSL05 | NUMBER | None |
HSL06 | NUMBER | None |
HSL07 | NUMBER | None |
HSL08 | NUMBER | None |
HSL09 | NUMBER | None |
HSL10 | NUMBER | None |
HSL11 | NUMBER | None |
HSL12 | NUMBER | None |
HSL13 | NUMBER | None |
HSL14 | NUMBER | None |
HSL15 | NUMBER | None |
HSL16 | NUMBER | None |
KSLVT | NUMBER | None |
KSL01 | NUMBER | None |
KSL02 | NUMBER | None |
KSL03 | NUMBER | None |
KSL04 | NUMBER | None |
KSL05 | NUMBER | None |
KSL06 | NUMBER | None |
KSL07 | NUMBER | None |
KSL08 | NUMBER | None |
KSL09 | NUMBER | None |
KSL10 | NUMBER | None |
KSL11 | NUMBER | None |
KSL12 | NUMBER | None |
KSL13 | NUMBER | None |
KSL14 | NUMBER | None |
KSL15 | NUMBER | None |
KSL16 | NUMBER | None |
OSLVT | NUMBER | None |
OSL01 | NUMBER | None |
OSL02 | NUMBER | None |
OSL03 | NUMBER | None |
OSL04 | NUMBER | None |
OSL05 | NUMBER | None |
OSL06 | NUMBER | None |
OSL07 | NUMBER | None |
OSL08 | NUMBER | None |
OSL09 | NUMBER | None |
OSL10 | NUMBER | None |
OSL11 | NUMBER | None |
OSL12 | NUMBER | None |
OSL13 | NUMBER | None |
OSL14 | NUMBER | None |
OSL15 | NUMBER | None |
OSL16 | NUMBER | None |
MSLVT | NUMBER | None |
MSL01 | NUMBER | None |
MSL02 | NUMBER | None |
MSL03 | NUMBER | None |
MSL04 | NUMBER | None |
MSL05 | NUMBER | None |
MSL06 | NUMBER | None |
MSL07 | NUMBER | None |
MSL08 | NUMBER | None |
MSL09 | NUMBER | None |
MSL10 | NUMBER | None |
MSL11 | NUMBER | None |
MSL12 | NUMBER | None |
MSL13 | NUMBER | None |
MSL14 | NUMBER | None |
MSL15 | NUMBER | None |
MSL16 | NUMBER | None |
TIMESTAMP | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a data type casting and column selection operation on the 'stg_sap__kna1_tmp' table. It first casts all columns to specific data types (mostly TEXT, with some BOOLEAN, DECIMAL, and TIMESTAMP) in the 'fields' CTE. Then, it selects a subset of these columns in the 'final' CTE. The query doesn't filter, aggregate, or transform the data beyond these casting and selection operations.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__kna1_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS _vso_r_dpoint,
CAST(NULL AS TEXT) AS _vso_r_i_no_lyr,
CAST(NULL AS TEXT) AS _vso_r_load_pref,
CAST(NULL AS TEXT) AS _vso_r_matpal,
CAST(NULL AS TEXT) AS _vso_r_one_mat,
CAST(NULL AS TEXT) AS _vso_r_one_sort,
CAST(NULL AS TEXT) AS _vso_r_pal_ul,
CAST(NULL AS DECIMAL(28, 6)) AS _vso_r_palhgt,
CAST(NULL AS TEXT) AS _vso_r_pk_mat,
CAST(NULL AS TEXT) AS _vso_r_uld_side,
CAST(NULL AS TEXT) AS _xlso_client,
CAST(NULL AS TEXT) AS _xlso_customer,
CAST(NULL AS TEXT) AS _xlso_partner,
CAST(NULL AS TEXT) AS _xlso_pref_pay,
CAST(NULL AS TEXT) AS _xlso_sysid,
CAST(NULL AS TEXT) AS abrvw,
CAST(NULL AS TEXT) AS adrnr,
CAST(NULL AS TEXT) AS alc,
CAST(NULL AS TEXT) AS anred,
CAST(NULL AS TEXT) AS aufsd,
CAST(NULL AS TEXT) AS bahne,
CAST(NULL AS TEXT) AS bahns,
CAST(NULL AS TEXT) AS bbbnr,
CAST(NULL AS TEXT) AS bbsnr,
CAST(NULL AS TEXT) AS begru,
CAST(NULL AS TEXT) AS bran1,
CAST(NULL AS TEXT) AS bran2,
CAST(NULL AS TEXT) AS bran3,
CAST(NULL AS TEXT) AS bran4,
CAST(NULL AS TEXT) AS bran5,
CAST(NULL AS TEXT) AS brsch,
CAST(NULL AS TEXT) AS bubkz,
CAST(NULL AS TEXT) AS cassd,
CAST(NULL AS TEXT) AS ccc01,
CAST(NULL AS TEXT) AS ccc02,
CAST(NULL AS TEXT) AS ccc03,
CAST(NULL AS TEXT) AS ccc04,
CAST(NULL AS TEXT) AS cfopc,
CAST(NULL AS TEXT) AS cityc,
CAST(NULL AS TEXT) AS civve,
CAST(NULL AS TEXT) AS cnae,
CAST(NULL AS TEXT) AS comsize,
CAST(NULL AS TEXT) AS confs,
CAST(NULL AS TEXT) AS counc,
CAST(NULL AS TEXT) AS crtn,
CAST(NULL AS TEXT) AS cvp_xblck,
CAST(NULL AS TEXT) AS datlt,
CAST(NULL AS TEXT) AS dear1,
CAST(NULL AS TEXT) AS dear2,
CAST(NULL AS TEXT) AS dear3,
CAST(NULL AS TEXT) AS dear4,
CAST(NULL AS TEXT) AS dear5,
CAST(NULL AS TEXT) AS dear6,
CAST(NULL AS TEXT) AS decregpc,
CAST(NULL AS TEXT) AS dtams,
CAST(NULL AS TEXT) AS dtaws,
CAST(NULL AS TEXT) AS duefl,
CAST(NULL AS TEXT) AS duns,
CAST(NULL AS TEXT) AS duns4,
CAST(NULL AS TEXT) AS ekont,
CAST(NULL AS TEXT) AS erdat,
CAST(NULL AS TEXT) AS ernam,
CAST(NULL AS TEXT) AS etikg,
CAST(NULL AS TEXT) AS exabl,
CAST(NULL AS TEXT) AS exp,
CAST(NULL AS TEXT) AS faksd,
CAST(NULL AS TEXT) AS fee_schedule,
CAST(NULL AS TEXT) AS fiskn,
CAST(NULL AS TEXT) AS fityp,
CAST(NULL AS TEXT) AS gform,
CAST(NULL AS TEXT) AS hzuor,
CAST(NULL AS TEXT) AS icmstaxpay,
CAST(NULL AS TEXT) AS indtyp,
CAST(NULL AS TEXT) AS inspatdebi,
CAST(NULL AS TEXT) AS inspbydebi,
CAST(NULL AS TEXT) AS j_1kfrepre,
CAST(NULL AS TEXT) AS j_1kftbus,
CAST(NULL AS TEXT) AS j_1kftind,
CAST(NULL AS TEXT) AS jmjah,
CAST(NULL AS TEXT) AS jmzah,
CAST(NULL AS TEXT) AS katr1,
CAST(NULL AS TEXT) AS katr10,
CAST(NULL AS TEXT) AS katr2,
CAST(NULL AS TEXT) AS katr3,
CAST(NULL AS TEXT) AS katr4,
CAST(NULL AS TEXT) AS katr5,
CAST(NULL AS TEXT) AS katr6,
CAST(NULL AS TEXT) AS katr7,
CAST(NULL AS TEXT) AS katr8,
CAST(NULL AS TEXT) AS katr9,
CAST(NULL AS TEXT) AS kdkg1,
CAST(NULL AS TEXT) AS kdkg2,
CAST(NULL AS TEXT) AS kdkg3,
CAST(NULL AS TEXT) AS kdkg4,
CAST(NULL AS TEXT) AS kdkg5,
CAST(NULL AS TEXT) AS knazk,
CAST(NULL AS TEXT) AS knrza,
CAST(NULL AS TEXT) AS knurl,
CAST(NULL AS TEXT) AS konzs,
CAST(NULL AS TEXT) AS ktocd,
CAST(NULL AS TEXT) AS ktokd,
CAST(NULL AS TEXT) AS kukla,
CAST(NULL AS TEXT) AS kunnr,
CAST(NULL AS TEXT) AS land1,
CAST(NULL AS TEXT) AS legalnat,
CAST(NULL AS TEXT) AS lifnr,
CAST(NULL AS TEXT) AS lifsd,
CAST(NULL AS TEXT) AS locco,
CAST(NULL AS TEXT) AS loevm,
CAST(NULL AS TEXT) AS lzone,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mcod1,
CAST(NULL AS TEXT) AS mcod2,
CAST(NULL AS TEXT) AS mcod3,
CAST(NULL AS TEXT) AS milve,
CAST(NULL AS TEXT) AS name1,
CAST(NULL AS TEXT) AS name2,
CAST(NULL AS TEXT) AS name3,
CAST(NULL AS TEXT) AS name4,
CAST(NULL AS TEXT) AS niels,
CAST(NULL AS TEXT) AS nodel,
CAST(NULL AS TEXT) AS oid_poreqd,
CAST(NULL AS TEXT) AS oidrc,
CAST(NULL AS TEXT) AS oipbl,
CAST(NULL AS TEXT) AS ort01,
CAST(NULL AS TEXT) AS ort02,
CAST(NULL AS TEXT) AS periv,
CAST(NULL AS TEXT) AS pfach,
CAST(NULL AS TEXT) AS pfort,
CAST(NULL AS TEXT) AS pmt_office,
CAST(NULL AS TEXT) AS psofg,
CAST(NULL AS TEXT) AS psohs,
CAST(NULL AS TEXT) AS psois,
CAST(NULL AS TEXT) AS pson1,
CAST(NULL AS TEXT) AS pson2,
CAST(NULL AS TEXT) AS pson3,
CAST(NULL AS TEXT) AS psoo1,
CAST(NULL AS TEXT) AS psoo2,
CAST(NULL AS TEXT) AS psoo3,
CAST(NULL AS TEXT) AS psoo4,
CAST(NULL AS TEXT) AS psoo5,
CAST(NULL AS TEXT) AS psost,
CAST(NULL AS TEXT) AS psotl,
CAST(NULL AS TEXT) AS psovn,
CAST(NULL AS TEXT) AS pstl2,
CAST(NULL AS TEXT) AS pstlz,
CAST(NULL AS TEXT) AS regio,
CAST(NULL AS TEXT) AS rg,
CAST(NULL AS TEXT) AS rgdate,
CAST(NULL AS TEXT) AS ric,
CAST(NULL AS TEXT) AS rne,
CAST(NULL AS TEXT) AS rnedate,
CAST(NULL AS TEXT) AS rpmkr,
CAST(NULL AS TEXT) AS sortl,
CAST(NULL AS TEXT) AS sperr,
CAST(NULL AS TEXT) AS sperz,
CAST(NULL AS TEXT) AS spras,
CAST(NULL AS TEXT) AS stcd1,
CAST(NULL AS TEXT) AS stcd2,
CAST(NULL AS TEXT) AS stcd3,
CAST(NULL AS TEXT) AS stcd4,
CAST(NULL AS TEXT) AS stcd5,
CAST(NULL AS TEXT) AS stcdt,
CAST(NULL AS TEXT) AS stceg,
CAST(NULL AS TEXT) AS stkza,
CAST(NULL AS TEXT) AS stkzn,
CAST(NULL AS TEXT) AS stkzu,
CAST(NULL AS TEXT) AS stras,
CAST(NULL AS TEXT) AS suframa,
CAST(NULL AS TEXT) AS tdt,
CAST(NULL AS TEXT) AS telbx,
CAST(NULL AS TEXT) AS telf1,
CAST(NULL AS TEXT) AS telf2,
CAST(NULL AS TEXT) AS telfx,
CAST(NULL AS TEXT) AS teltx,
CAST(NULL AS TEXT) AS telx1,
CAST(NULL AS TEXT) AS txjcd,
CAST(NULL AS TEXT) AS txlw1,
CAST(NULL AS TEXT) AS txlw2,
CAST(NULL AS TEXT) AS uf,
CAST(NULL AS TEXT) AS umjah,
CAST(NULL AS DECIMAL(28, 6)) AS umsa1,
CAST(NULL AS DECIMAL(28, 6)) AS umsat,
CAST(NULL AS TEXT) AS updat,
CAST(NULL AS TEXT) AS uptim,
CAST(NULL AS TEXT) AS uwaer,
CAST(NULL AS TEXT) AS vbund,
CAST(NULL AS TEXT) AS werks,
CAST(NULL AS TEXT) AS xcpdk,
CAST(NULL AS TEXT) AS xicms,
CAST(NULL AS TEXT) AS xknza,
CAST(NULL AS TEXT) AS xsubt,
CAST(NULL AS TEXT) AS xxipi,
CAST(NULL AS TEXT) AS xzemp
FROM base
), final AS (
SELECT
mandt,
kunnr,
brsch,
ktokd,
kukla,
land1,
lifnr,
loevm,
name1,
name2,
name3,
niels,
ort01,
ort02,
periv,
pfach,
pfort,
pstl2,
pstlz,
regio,
counc,
sortl,
spras,
stcd1,
stcd2,
stcd3,
stras,
telf1,
telfx,
xcpdk,
vbund,
dear6,
bran1,
bran2,
bran3,
bran4,
bran5,
abrvw,
werks
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
kunnr | None | Customer number |
brsch | None | Industry key |
ktokd | None | Customer account group |
kukla | None | Customer classification |
land1 | None | Country key |
lifnr | None | Account number of vendor or creditor |
loevm | None | Central deletion flag for master record |
name1 | None | Name 1 |
name2 | None | Name 2 |
name3 | None | Name 3 |
niels | None | Nielsen ID |
ort01 | None | City |
ort02 | None | District |
periv | None | Fiscal year variant |
pfach | None | PO Box |
pfort | None | PO Box city |
pstl2 | None | PO Box postal code |
pstlz | None | Postal code |
regio | None | Regional market |
counc | None | County code |
sortl | None | Sort field |
spras | None | Language key |
stcd1 | None | Tax number 1 |
stcd2 | None | Tax number 2 |
stcd3 | None | Tax number 3 |
stras | None | House number and street |
telf1 | None | First telephone number |
telfx | None | Fax number |
xcpdk | None | Indictoar (Is the account a one-time account?) |
vbund | None | Company id of trading partner |
dear6 | None | Indicator (Consumer) |
bran1 | None | Industry code 1 |
bran2 | None | Industry code 2 |
bran3 | None | Industry code 3 |
bran4 | None | Industry code 4 |
bran5 | None | Industry code 5 |
abrvw | None | Usage indicator |
werks | None | Plant |
MANDT | TEXT | None |
KUNNR | TEXT | None |
BRSCH | NUMBER | None |
KTOKD | TEXT | None |
KUKLA | NUMBER | None |
LAND1 | TEXT | None |
LIFNR | NUMBER | None |
LOEVM | NUMBER | None |
NAME1 | TEXT | None |
NAME2 | NUMBER | None |
NAME3 | NUMBER | None |
NIELS | NUMBER | None |
ORT01 | TEXT | None |
ORT02 | NUMBER | None |
PERIV | NUMBER | None |
PFACH | NUMBER | None |
PFORT | NUMBER | None |
PSTL2 | NUMBER | None |
PSTLZ | TEXT | None |
REGIO | TEXT | None |
COUNC | NUMBER | None |
SORTL | TEXT | None |
SPRAS | NUMBER | None |
STCD1 | NUMBER | None |
STCD2 | NUMBER | None |
STCD3 | NUMBER | None |
STRAS | TEXT | None |
TELF1 | NUMBER | None |
TELFX | NUMBER | None |
XCPDK | NUMBER | None |
VBUND | NUMBER | None |
DEAR6 | NUMBER | None |
BRAN1 | NUMBER | None |
BRAN2 | NUMBER | None |
BRAN3 | NUMBER | None |
BRAN4 | NUMBER | None |
BRAN5 | NUMBER | None |
ABRVW | NUMBER | None |
WERKS | NUMBER | None |
This SQL query selects all columns and rows from the table 'kna1' in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.kna1
Name | Type | Comment |
---|---|---|
KUNNR | TEXT | None |
MANDT | TEXT | None |
LAND1 | TEXT | None |
NAME1 | TEXT | None |
NAME2 | NUMBER | None |
ORT01 | TEXT | None |
PSTLZ | TEXT | None |
REGIO | TEXT | None |
SORTL | TEXT | None |
STRAS | TEXT | None |
TELF1 | NUMBER | None |
TELFX | NUMBER | None |
XCPDK | NUMBER | None |
ADRNR | TEXT | None |
MCOD1 | TEXT | None |
MCOD2 | NUMBER | None |
MCOD3 | TEXT | None |
ANRED | NUMBER | None |
AUFSD | NUMBER | None |
BAHNE | NUMBER | None |
BAHNS | NUMBER | None |
BBBNR | TEXT | None |
BBSNR | TEXT | None |
BEGRU | NUMBER | None |
BRSCH | NUMBER | None |
BUBKZ | NUMBER | None |
DATLT | NUMBER | None |
ERDAT | TEXT | None |
ERNAM | TEXT | None |
EXABL | NUMBER | None |
FAKSD | NUMBER | None |
FISKN | NUMBER | None |
KNAZK | NUMBER | None |
KNRZA | NUMBER | None |
KONZS | NUMBER | None |
KTOKD | TEXT | None |
KUKLA | NUMBER | None |
LIFNR | NUMBER | None |
LIFSD | NUMBER | None |
LOCCO | NUMBER | None |
LOEVM | NUMBER | None |
NAME3 | NUMBER | None |
NAME4 | NUMBER | None |
NIELS | NUMBER | None |
ORT02 | NUMBER | None |
PFACH | NUMBER | None |
PSTL2 | NUMBER | None |
COUNC | NUMBER | None |
CITYC | NUMBER | None |
RPMKR | NUMBER | None |
SPERR | NUMBER | None |
SPRAS | NUMBER | None |
STCD1 | NUMBER | None |
STCD2 | NUMBER | None |
STKZA | NUMBER | None |
STKZU | NUMBER | None |
TELBX | NUMBER | None |
TELF2 | NUMBER | None |
TELTX | NUMBER | None |
TELX1 | NUMBER | None |
LZONE | NUMBER | None |
XZEMP | NUMBER | None |
VBUND | NUMBER | None |
STCEG | NUMBER | None |
DEAR1 | NUMBER | None |
DEAR2 | NUMBER | None |
DEAR3 | NUMBER | None |
DEAR4 | NUMBER | None |
DEAR5 | NUMBER | None |
GFORM | NUMBER | None |
BRAN1 | NUMBER | None |
BRAN2 | NUMBER | None |
BRAN3 | NUMBER | None |
BRAN4 | NUMBER | None |
BRAN5 | NUMBER | None |
EKONT | NUMBER | None |
UMSAT | NUMBER | None |
UMJAH | TEXT | None |
UWAER | NUMBER | None |
JMZAH | TEXT | None |
JMJAH | TEXT | None |
KATR1 | NUMBER | None |
KATR2 | NUMBER | None |
KATR3 | NUMBER | None |
KATR4 | NUMBER | None |
KATR5 | NUMBER | None |
KATR6 | NUMBER | None |
KATR7 | NUMBER | None |
KATR8 | NUMBER | None |
KATR9 | NUMBER | None |
KATR10 | NUMBER | None |
STKZN | NUMBER | None |
UMSA1 | NUMBER | None |
TXJCD | NUMBER | None |
PERIV | NUMBER | None |
ABRVW | NUMBER | None |
INSPBYDEBI | NUMBER | None |
INSPATDEBI | NUMBER | None |
KTOCD | NUMBER | None |
PFORT | NUMBER | None |
WERKS | NUMBER | None |
DTAMS | NUMBER | None |
DTAWS | NUMBER | None |
DUEFL | TEXT | None |
HZUOR | TEXT | None |
SPERZ | NUMBER | None |
ETIKG | NUMBER | None |
CIVVE | TEXT | None |
MILVE | NUMBER | None |
KDKG1 | NUMBER | None |
KDKG2 | NUMBER | None |
KDKG3 | NUMBER | None |
KDKG4 | NUMBER | None |
KDKG5 | NUMBER | None |
XKNZA | NUMBER | None |
FITYP | NUMBER | None |
STCDT | NUMBER | None |
STCD3 | NUMBER | None |
STCD4 | NUMBER | None |
STCD5 | NUMBER | None |
XICMS | NUMBER | None |
XXIPI | NUMBER | None |
XSUBT | NUMBER | None |
CFOPC | NUMBER | None |
TXLW1 | NUMBER | None |
TXLW2 | NUMBER | None |
CCC01 | NUMBER | None |
CCC02 | NUMBER | None |
CCC03 | NUMBER | None |
CCC04 | NUMBER | None |
CASSD | NUMBER | None |
KNURL | NUMBER | None |
J_1KFREPRE | NUMBER | None |
J_1KFTBUS | NUMBER | None |
J_1KFTIND | NUMBER | None |
CONFS | NUMBER | None |
UPDAT | TEXT | None |
UPTIM | TEXT | None |
NODEL | NUMBER | None |
DEAR6 | NUMBER | None |
CVP_XBLCK | NUMBER | None |
SUFRAMA | NUMBER | None |
RG | NUMBER | None |
EXP | NUMBER | None |
UF | NUMBER | None |
RGDATE | TEXT | None |
RIC | TEXT | None |
RNE | NUMBER | None |
RNEDATE | TEXT | None |
CNAE | NUMBER | None |
LEGALNAT | TEXT | None |
CRTN | NUMBER | None |
ICMSTAXPAY | NUMBER | None |
INDTYP | NUMBER | None |
TDT | NUMBER | None |
COMSIZE | NUMBER | None |
DECREGPC | NUMBER | None |
_VSO_R_PALHGT | NUMBER | None |
_VSO_R_PAL_UL | NUMBER | None |
_VSO_R_PK_MAT | NUMBER | None |
_VSO_R_MATPAL | NUMBER | None |
_VSO_R_I_NO_LYR | TEXT | None |
_VSO_R_ONE_MAT | NUMBER | None |
_VSO_R_ONE_SORT | NUMBER | None |
_VSO_R_ULD_SIDE | TEXT | None |
_VSO_R_LOAD_PREF | TEXT | None |
_VSO_R_DPOINT | NUMBER | None |
_XLSO_CUSTOMER | NUMBER | None |
_XLSO_SYSID | NUMBER | None |
_XLSO_CLIENT | NUMBER | None |
_XLSO_PARTNER | NUMBER | None |
_XLSO_PREF_PAY | NUMBER | None |
ALC | NUMBER | None |
PMT_OFFICE | NUMBER | None |
FEE_SCHEDULE | NUMBER | None |
DUNS | NUMBER | None |
DUNS4 | NUMBER | None |
PSOFG | NUMBER | None |
PSOIS | NUMBER | None |
PSON1 | NUMBER | None |
PSON2 | NUMBER | None |
PSON3 | NUMBER | None |
PSOVN | NUMBER | None |
PSOTL | NUMBER | None |
PSOHS | NUMBER | None |
PSOST | NUMBER | None |
PSOO1 | NUMBER | None |
PSOO2 | NUMBER | None |
PSOO3 | NUMBER | None |
PSOO4 | NUMBER | None |
PSOO5 | NUMBER | None |
OIDRC | NUMBER | None |
OID_POREQD | NUMBER | None |
OIPBL | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a simple data extraction and column selection from a staging table 'stg_sap__lfa1_tmp'. It first creates a CTE named 'base' to select all columns from the source table. Then, it defines another CTE named 'fields' where it explicitly casts all columns to specific data types, although all casts are to NULL. Finally, it selects a subset of columns from the 'fields' CTE in the 'final' CTE, which is then used in the main SELECT statement. The query essentially extracts specific columns from the source table while ensuring consistent data types.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__lfa1_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS actss,
CAST(NULL AS TEXT) AS adrnr,
CAST(NULL AS TEXT) AS alc,
CAST(NULL AS TEXT) AS anred,
CAST(NULL AS TEXT) AS bahns,
CAST(NULL AS TEXT) AS bbbnr,
CAST(NULL AS TEXT) AS bbsnr,
CAST(NULL AS TEXT) AS begru,
CAST(NULL AS TEXT) AS brsch,
CAST(NULL AS TEXT) AS bubkz,
CAST(NULL AS TEXT) AS carrier_conf,
CAST(NULL AS TEXT) AS cnae,
CAST(NULL AS TEXT) AS comsize,
CAST(NULL AS TEXT) AS confs,
CAST(NULL AS TEXT) AS crc_num,
CAST(NULL AS TEXT) AS crtn,
CAST(NULL AS TEXT) AS cvp_xblck,
CAST(NULL AS TEXT) AS datlt,
CAST(NULL AS TEXT) AS decregpc,
CAST(NULL AS TEXT) AS dlgrp,
CAST(NULL AS TEXT) AS dtams,
CAST(NULL AS TEXT) AS dtaws,
CAST(NULL AS TEXT) AS duefl,
CAST(NULL AS TEXT) AS emnfr,
CAST(NULL AS TEXT) AS erdat,
CAST(NULL AS TEXT) AS ernam,
CAST(NULL AS TEXT) AS esrnr,
CAST(NULL AS TEXT) AS exp,
CAST(NULL AS TEXT) AS fiskn,
CAST(NULL AS TEXT) AS fisku,
CAST(NULL AS TEXT) AS fityp,
CAST(NULL AS TEXT) AS gbdat,
CAST(NULL AS TEXT) AS gbort,
CAST(NULL AS TEXT) AS icmstaxpay,
CAST(NULL AS TEXT) AS indtyp,
CAST(NULL AS TEXT) AS ipisp,
CAST(NULL AS TEXT) AS j_1kfrepre,
CAST(NULL AS TEXT) AS j_1kftbus,
CAST(NULL AS TEXT) AS j_1kftind,
CAST(NULL AS DECIMAL(28, 6)) AS j_sc_capital,
CAST(NULL AS TEXT) AS j_sc_currency,
CAST(NULL AS TEXT) AS konzs,
CAST(NULL AS TEXT) AS kraus,
CAST(NULL AS TEXT) AS ktock,
CAST(NULL AS TEXT) AS ktokk,
CAST(NULL AS TEXT) AS kunnr,
CAST(NULL AS TEXT) AS land1,
CAST(NULL AS TEXT) AS legalnat,
CAST(NULL AS TEXT) AS lfurl,
CAST(NULL AS TEXT) AS lifnr,
CAST(NULL AS TEXT) AS lnrza,
CAST(NULL AS TEXT) AS loevm,
CAST(NULL AS TEXT) AS ltsna,
CAST(NULL AS TEXT) AS lzone,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mcod1,
CAST(NULL AS TEXT) AS mcod2,
CAST(NULL AS TEXT) AS mcod3,
CAST(NULL AS TEXT) AS min_comp,
CAST(NULL AS TEXT) AS name1,
CAST(NULL AS TEXT) AS name2,
CAST(NULL AS TEXT) AS name3,
CAST(NULL AS TEXT) AS name4,
CAST(NULL AS TEXT) AS nodel,
CAST(NULL AS TEXT) AS ort01,
CAST(NULL AS TEXT) AS ort02,
CAST(NULL AS TEXT) AS pfach,
CAST(NULL AS TEXT) AS pfort,
CAST(NULL AS TEXT) AS plkal,
CAST(NULL AS TEXT) AS pmt_office,
CAST(NULL AS TEXT) AS podkzb,
CAST(NULL AS TEXT) AS ppa_relevant,
CAST(NULL AS TEXT) AS profs,
CAST(NULL AS TEXT) AS psofg,
CAST(NULL AS TEXT) AS psohs,
CAST(NULL AS TEXT) AS psois,
CAST(NULL AS TEXT) AS pson1,
CAST(NULL AS TEXT) AS pson2,
CAST(NULL AS TEXT) AS pson3,
CAST(NULL AS TEXT) AS psost,
CAST(NULL AS TEXT) AS psotl,
CAST(NULL AS TEXT) AS psovn,
CAST(NULL AS TEXT) AS pstl2,
CAST(NULL AS TEXT) AS pstlz,
CAST(NULL AS TEXT) AS qssys,
CAST(NULL AS TEXT) AS qssysdat,
CAST(NULL AS TEXT) AS regio,
CAST(NULL AS TEXT) AS regss,
CAST(NULL AS TEXT) AS revdb,
CAST(NULL AS TEXT) AS rg,
CAST(NULL AS TEXT) AS rgdate,
CAST(NULL AS TEXT) AS ric,
CAST(NULL AS TEXT) AS rne,
CAST(NULL AS TEXT) AS rnedate,
CAST(NULL AS TEXT) AS scacd,
CAST(NULL AS TEXT) AS scheduling_type,
CAST(NULL AS TEXT) AS sexkz,
CAST(NULL AS TEXT) AS sfrgr,
CAST(NULL AS TEXT) AS sortl,
CAST(NULL AS TEXT) AS sperm,
CAST(NULL AS TEXT) AS sperq,
CAST(NULL AS TEXT) AS sperr,
CAST(NULL AS TEXT) AS sperz,
CAST(NULL AS TEXT) AS spras,
CAST(NULL AS DECIMAL(28, 6)) AS staging_time,
CAST(NULL AS TEXT) AS stcd1,
CAST(NULL AS TEXT) AS stcd2,
CAST(NULL AS TEXT) AS stcd3,
CAST(NULL AS TEXT) AS stcd4,
CAST(NULL AS TEXT) AS stcd5,
CAST(NULL AS TEXT) AS stcdt,
CAST(NULL AS TEXT) AS stceg,
CAST(NULL AS TEXT) AS stenr,
CAST(NULL AS TEXT) AS stgdl,
CAST(NULL AS TEXT) AS stkza,
CAST(NULL AS TEXT) AS stkzn,
CAST(NULL AS TEXT) AS stkzu,
CAST(NULL AS TEXT) AS stras,
CAST(NULL AS TEXT) AS submi_relevant,
CAST(NULL AS TEXT) AS taxbs,
CAST(NULL AS TEXT) AS tdt,
CAST(NULL AS TEXT) AS telbx,
CAST(NULL AS TEXT) AS telf1,
CAST(NULL AS TEXT) AS telf2,
CAST(NULL AS TEXT) AS telfx,
CAST(NULL AS TEXT) AS teltx,
CAST(NULL AS TEXT) AS telx1,
CAST(NULL AS TEXT) AS term_li,
CAST(NULL AS TEXT) AS transport_chain,
CAST(NULL AS TEXT) AS txjcd,
CAST(NULL AS TEXT) AS uf,
CAST(NULL AS TEXT) AS updat,
CAST(NULL AS TEXT) AS uptim,
CAST(NULL AS TEXT) AS vbund,
CAST(NULL AS TEXT) AS werkr,
CAST(NULL AS TEXT) AS werks,
CAST(NULL AS TEXT) AS xcpdk,
CAST(NULL AS TEXT) AS xlfza,
CAST(NULL AS TEXT) AS xzemp
FROM base
), final AS (
SELECT
mandt,
lifnr,
brsch,
ktokk,
land1,
loevm,
name1,
name2,
name3,
ort01,
ort02,
pfach,
pstl2,
pstlz,
regio,
sortl,
spras,
stcd1,
stcd2,
stcd3,
stras,
telf1,
telfx,
xcpdk,
vbund,
kraus,
pfort,
werks
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
lifnr | None | Account number of vendor or creditor |
brsch | None | Industry key |
ktokk | None | Vendor account group |
land1 | None | Country key |
loevm | None | Central deletion flag for master record |
name1 | None | Name 1 |
name2 | None | Name 2 |
name3 | None | Name 3 |
ort01 | None | City |
ort02 | None | District |
pfach | None | PO Box |
pstl2 | None | P.O. Box postal code |
pstlz | None | Postal code |
regio | None | Region (State, province, county) |
sortl | None | Sort field |
spras | None | Language key |
stcd1 | None | Tax number 1 |
stcd2 | None | Tax number 2 |
stcd3 | None | Tax number 3 |
stras | None | Street and house number |
telf1 | None | First telephone number |
telfx | None | Fax number |
xcpdk | None | Indicator (is the account a one-time account?) |
vbund | None | Company id of trading partner |
kraus | None | Credit information number |
pfort | None | PO box city |
werks | None | Plant |
MANDT | TEXT | None |
LIFNR | TEXT | None |
BRSCH | TEXT | None |
KTOKK | TEXT | None |
LAND1 | TEXT | None |
LOEVM | NUMBER | None |
NAME1 | TEXT | None |
NAME2 | NUMBER | None |
NAME3 | NUMBER | None |
ORT01 | TEXT | None |
ORT02 | TEXT | None |
PFACH | NUMBER | None |
PSTL2 | NUMBER | None |
PSTLZ | TEXT | None |
REGIO | TEXT | None |
SORTL | TEXT | None |
SPRAS | TEXT | None |
STCD1 | NUMBER | None |
STCD2 | NUMBER | None |
STCD3 | NUMBER | None |
STRAS | TEXT | None |
TELF1 | NUMBER | None |
TELFX | NUMBER | None |
XCPDK | NUMBER | None |
VBUND | NUMBER | None |
KRAUS | NUMBER | None |
PFORT | NUMBER | None |
WERKS | NUMBER | None |
This SQL query selects all columns and rows from the table 'lfa1' in the 'sap' schema of the 'TEST' database. It's a straightforward SELECT * statement without any filtering, transformations, or joins.
OtherSELECT
*
FROM TEST.sap.lfa1
Name | Type | Comment |
---|---|---|
LIFNR | TEXT | None |
MANDT | TEXT | None |
LAND1 | TEXT | None |
NAME1 | TEXT | None |
NAME2 | NUMBER | None |
NAME3 | NUMBER | None |
NAME4 | NUMBER | None |
ORT01 | TEXT | None |
ORT02 | TEXT | None |
PFACH | NUMBER | None |
PSTL2 | NUMBER | None |
PSTLZ | TEXT | None |
REGIO | TEXT | None |
SORTL | TEXT | None |
STRAS | TEXT | None |
ADRNR | TEXT | None |
MCOD1 | TEXT | None |
MCOD2 | NUMBER | None |
MCOD3 | TEXT | None |
ANRED | TEXT | None |
BAHNS | NUMBER | None |
BBBNR | TEXT | None |
BBSNR | TEXT | None |
BEGRU | NUMBER | None |
BRSCH | TEXT | None |
BUBKZ | TEXT | None |
DATLT | NUMBER | None |
DTAMS | NUMBER | None |
DTAWS | NUMBER | None |
ERDAT | TEXT | None |
ERNAM | TEXT | None |
ESRNR | NUMBER | None |
KONZS | NUMBER | None |
KTOKK | TEXT | None |
KUNNR | NUMBER | None |
LNRZA | NUMBER | None |
LOEVM | NUMBER | None |
SPERR | NUMBER | None |
SPERM | NUMBER | None |
SPRAS | TEXT | None |
STCD1 | NUMBER | None |
STCD2 | NUMBER | None |
STKZA | NUMBER | None |
STKZU | NUMBER | None |
TELBX | NUMBER | None |
TELF1 | NUMBER | None |
TELF2 | NUMBER | None |
TELFX | NUMBER | None |
TELTX | NUMBER | None |
TELX1 | NUMBER | None |
XCPDK | NUMBER | None |
XZEMP | NUMBER | None |
VBUND | NUMBER | None |
FISKN | NUMBER | None |
STCEG | NUMBER | None |
STKZN | NUMBER | None |
SPERQ | NUMBER | None |
GBORT | NUMBER | None |
GBDAT | TEXT | None |
SEXKZ | NUMBER | None |
KRAUS | NUMBER | None |
REVDB | TEXT | None |
QSSYS | NUMBER | None |
KTOCK | NUMBER | None |
PFORT | NUMBER | None |
WERKS | NUMBER | None |
LTSNA | NUMBER | None |
WERKR | NUMBER | None |
PLKAL | NUMBER | None |
DUEFL | TEXT | None |
TXJCD | TEXT | None |
SPERZ | NUMBER | None |
SCACD | NUMBER | None |
SFRGR | NUMBER | None |
LZONE | NUMBER | None |
XLFZA | NUMBER | None |
DLGRP | NUMBER | None |
FITYP | NUMBER | None |
STCDT | NUMBER | None |
REGSS | NUMBER | None |
ACTSS | NUMBER | None |
STCD3 | NUMBER | None |
STCD4 | NUMBER | None |
STCD5 | NUMBER | None |
IPISP | NUMBER | None |
TAXBS | TEXT | None |
PROFS | NUMBER | None |
STGDL | NUMBER | None |
EMNFR | NUMBER | None |
LFURL | NUMBER | None |
J_1KFREPRE | NUMBER | None |
J_1KFTBUS | NUMBER | None |
J_1KFTIND | NUMBER | None |
CONFS | NUMBER | None |
UPDAT | TEXT | None |
UPTIM | TEXT | None |
NODEL | NUMBER | None |
QSSYSDAT | TEXT | None |
PODKZB | NUMBER | None |
FISKU | NUMBER | None |
STENR | NUMBER | None |
CARRIER_CONF | NUMBER | None |
MIN_COMP | NUMBER | None |
TERM_LI | NUMBER | None |
CRC_NUM | NUMBER | None |
CVP_XBLCK | NUMBER | None |
RG | NUMBER | None |
EXP | NUMBER | None |
UF | NUMBER | None |
RGDATE | TEXT | None |
RIC | TEXT | None |
RNE | NUMBER | None |
RNEDATE | TEXT | None |
CNAE | NUMBER | None |
LEGALNAT | TEXT | None |
CRTN | NUMBER | None |
ICMSTAXPAY | NUMBER | None |
INDTYP | NUMBER | None |
TDT | NUMBER | None |
COMSIZE | NUMBER | None |
DECREGPC | NUMBER | None |
J_SC_CAPITAL | NUMBER | None |
J_SC_CURRENCY | NUMBER | None |
ALC | NUMBER | None |
PMT_OFFICE | NUMBER | None |
PPA_RELEVANT | NUMBER | None |
PSOFG | NUMBER | None |
PSOIS | NUMBER | None |
PSON1 | NUMBER | None |
PSON2 | NUMBER | None |
PSON3 | NUMBER | None |
PSOVN | NUMBER | None |
PSOTL | NUMBER | None |
PSOHS | NUMBER | None |
PSOST | NUMBER | None |
TRANSPORT_CHAIN | NUMBER | None |
STAGING_TIME | NUMBER | None |
SCHEDULING_TYPE | NUMBER | None |
SUBMI_RELEVANT | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a data type conversion and column selection operation on a staging table for SAP material data (MARA). It casts all columns to specific data types (mostly TEXT, with some DECIMAL and TIMESTAMP) and then selects a subset of these columns for the final output. The query doesn't filter, transform, or aggregate the data beyond these type conversions and column selections.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__mara_tmp
), fields AS (
SELECT
CAST(NULL AS TEXT) AS _accgo_assgd_uom,
CAST(NULL AS TEXT) AS _bev1_luldegrp,
CAST(NULL AS TEXT) AS _bev1_luleinh,
CAST(NULL AS TEXT) AS _bev1_nestruccat,
CAST(NULL AS TEXT) AS _dsd_sl_toltyp,
CAST(NULL AS TEXT) AS _dsd_sv_cnt_grp,
CAST(NULL AS TEXT) AS _dsd_vc_group,
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS _sttpec_country_ref,
CAST(NULL AS TEXT) AS _sttpec_prdcat,
CAST(NULL AS DECIMAL(28, 6)) AS _sttpec_sertype,
CAST(NULL AS TEXT) AS _sttpec_syncact,
CAST(NULL AS TEXT) AS _sttpec_syncchg,
CAST(NULL AS DECIMAL(28, 6)) AS _sttpec_synctime,
CAST(NULL AS TEXT) AS _vso_r_bot_ind,
CAST(NULL AS TEXT) AS _vso_r_kzgvh_ind,
CAST(NULL AS TEXT) AS _vso_r_no_p_gvh,
CAST(NULL AS DECIMAL(28, 6)) AS _vso_r_pal_b_ht,
CAST(NULL AS TEXT) AS _vso_r_pal_ind,
CAST(NULL AS DECIMAL(28, 6)) AS _vso_r_pal_min_h,
CAST(NULL AS DECIMAL(28, 6)) AS _vso_r_pal_ovr_d,
CAST(NULL AS DECIMAL(28, 6)) AS _vso_r_pal_ovr_w,
CAST(NULL AS TEXT) AS _vso_r_quan_unit,
CAST(NULL AS TEXT) AS _vso_r_stack_ind,
CAST(NULL AS TEXT) AS _vso_r_stack_no,
CAST(NULL AS TEXT) AS _vso_r_tilt_ind,
CAST(NULL AS DECIMAL(28, 6)) AS _vso_r_tol_b_ht,
CAST(NULL AS TEXT) AS _vso_r_top_ind,
CAST(NULL AS TEXT) AS adprof,
CAST(NULL AS TEXT) AS adspc_spc,
CAST(NULL AS TEXT) AS aeklk,
CAST(NULL AS TEXT) AS aenam,
CAST(NULL AS TEXT) AS aeszn,
CAST(NULL AS TEXT) AS allow_pmat_igno,
CAST(NULL AS TEXT) AS animal_origin,
CAST(NULL AS TEXT) AS anp,
CAST(NULL AS TEXT) AS attyp,
CAST(NULL AS TEXT) AS bbtyp,
CAST(NULL AS TEXT) AS begru,
CAST(NULL AS TEXT) AS behvo,
CAST(NULL AS TEXT) AS bflme,
CAST(NULL AS TEXT) AS bismt,
CAST(NULL AS TEXT) AS blanz,
CAST(NULL AS TEXT) AS blatt,
CAST(NULL AS TEXT) AS bmatn,
CAST(NULL AS TEXT) AS brand_id,
CAST(NULL AS DECIMAL(28, 6)) AS breit,
CAST(NULL AS DECIMAL(28, 6)) AS brgew,
CAST(NULL AS TEXT) AS bstat,
CAST(NULL AS TEXT) AS bstme,
CAST(NULL AS TEXT) AS bwscl,
CAST(NULL AS TEXT) AS bwvor,
CAST(NULL AS TEXT) AS cadkz,
CAST(NULL AS TEXT) AS care_code,
CAST(NULL AS TEXT) AS cmeth,
CAST(NULL AS TEXT) AS cmrel,
CAST(NULL AS TEXT) AS cobjid,
CAST(NULL AS TEXT) AS color,
CAST(NULL AS TEXT) AS color_atinn,
CAST(NULL AS TEXT) AS commodity,
CAST(NULL AS TEXT) AS compl,
CAST(NULL AS TEXT) AS cotype,
CAST(NULL AS TEXT) AS cuobf,
CAST(NULL AS TEXT) AS cwqproc,
CAST(NULL AS TEXT) AS cwqrel,
CAST(NULL AS TEXT) AS cwqtolgr,
CAST(NULL AS TEXT) AS datab,
CAST(NULL AS TEXT) AS dg_pack_status,
CAST(NULL AS TEXT) AS disst,
CAST(NULL AS TEXT) AS ean11,
CAST(NULL AS TEXT) AS eannr,
CAST(NULL AS TEXT) AS ekwsl,
CAST(NULL AS TEXT) AS entar,
CAST(NULL AS TEXT) AS ergei,
CAST(NULL AS DECIMAL(28, 6)) AS ergew,
CAST(NULL AS TEXT) AS ernam,
CAST(NULL AS TEXT) AS ersda,
CAST(NULL AS TEXT) AS ervoe,
CAST(NULL AS DECIMAL(28, 6)) AS ervol,
CAST(NULL AS TEXT) AS etiag,
CAST(NULL AS TEXT) AS etiar,
CAST(NULL AS TEXT) AS etifo,
CAST(NULL AS TEXT) AS extwg,
CAST(NULL AS TEXT) AS fashgrd,
CAST(NULL AS TEXT) AS ferth,
CAST(NULL AS TEXT) AS fiber_code1,
CAST(NULL AS TEXT) AS fiber_code2,
CAST(NULL AS TEXT) AS fiber_code3,
CAST(NULL AS TEXT) AS fiber_code4,
CAST(NULL AS TEXT) AS fiber_code5,
CAST(NULL AS TEXT) AS fiber_part1,
CAST(NULL AS TEXT) AS fiber_part2,
CAST(NULL AS TEXT) AS fiber_part3,
CAST(NULL AS TEXT) AS fiber_part4,
CAST(NULL AS TEXT) AS fiber_part5,
CAST(NULL AS TEXT) AS formt,
CAST(NULL AS TEXT) AS free_char,
CAST(NULL AS TEXT) AS fsh_mg_at1,
CAST(NULL AS TEXT) AS fsh_mg_at2,
CAST(NULL AS TEXT) AS fsh_mg_at3,
CAST(NULL AS TEXT) AS fsh_sc_mid,
CAST(NULL AS TEXT) AS fsh_seaim,
CAST(NULL AS TEXT) AS fsh_sealv,
CAST(NULL AS DECIMAL(28, 6)) AS fuelg,
CAST(NULL AS TEXT) AS gds_relevant,
CAST(NULL AS TEXT) AS gennr,
CAST(NULL AS TEXT) AS gewei,
CAST(NULL AS DECIMAL(28, 6)) AS gewto,
CAST(NULL AS TEXT) AS groes,
CAST(NULL AS TEXT) AS gtin_variant,
CAST(NULL AS TEXT) AS hazmat,
CAST(NULL AS TEXT) AS herkl,
CAST(NULL AS TEXT) AS hndlcode,
CAST(NULL AS DECIMAL(28, 6)) AS hoehe,
CAST(NULL AS TEXT) AS hutyp,
CAST(NULL AS TEXT) AS hutyp_dflt,
CAST(NULL AS TEXT) AS ihivi,
CAST(NULL AS TEXT) AS iloos,
CAST(NULL AS TEXT) AS imatn,
CAST(NULL AS DECIMAL(28, 6)) AS inhal,
CAST(NULL AS DECIMAL(28, 6)) AS inhbr,
CAST(NULL AS TEXT) AS inhme,
CAST(NULL AS TEXT) AS ipmipproduct,
CAST(NULL AS TEXT) AS iprkz,
CAST(NULL AS TEXT) AS kosch,
CAST(NULL AS TEXT) AS kunnr,
CAST(NULL AS TEXT) AS kzeff,
CAST(NULL AS TEXT) AS kzgvh,
CAST(NULL AS TEXT) AS kzkfg,
CAST(NULL AS TEXT) AS kzkup,
CAST(NULL AS TEXT) AS kznfm,
CAST(NULL AS TEXT) AS kzrev,
CAST(NULL AS TEXT) AS kzumw,
CAST(NULL AS TEXT) AS kzwsm,
CAST(NULL AS TEXT) AS labor,
CAST(NULL AS TEXT) AS laeda,
CAST(NULL AS DECIMAL(28, 6)) AS laeng,
CAST(NULL AS TEXT) AS liqdt,
CAST(NULL AS TEXT) AS loglev_reto,
CAST(NULL AS TEXT) AS logunit,
CAST(NULL AS TEXT) AS lvorm,
CAST(NULL AS TEXT) AS magrv,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS matfi,
CAST(NULL AS TEXT) AS matkl,
CAST(NULL AS TEXT) AS matnr,
CAST(NULL AS DECIMAL(28, 6)) AS maxb,
CAST(NULL AS DECIMAL(28, 6)) AS maxc,
CAST(NULL AS DECIMAL(28, 6)) AS maxc_tol,
CAST(NULL AS TEXT) AS maxdim_uom,
CAST(NULL AS DECIMAL(28, 6)) AS maxh,
CAST(NULL AS DECIMAL(28, 6)) AS maxl,
CAST(NULL AS TEXT) AS mbrsh,
CAST(NULL AS TEXT) AS mcond,
CAST(NULL AS TEXT) AS meabm,
CAST(NULL AS TEXT) AS medium,
CAST(NULL AS TEXT) AS meins,
CAST(NULL AS TEXT) AS mfrgr,
CAST(NULL AS TEXT) AS mfrnr,
CAST(NULL AS TEXT) AS mfrpn,
CAST(NULL AS DECIMAL(28, 6)) AS mhdhb,
CAST(NULL AS DECIMAL(28, 6)) AS mhdlp,
CAST(NULL AS DECIMAL(28, 6)) AS mhdrz,
CAST(NULL AS TEXT) AS mlgut,
CAST(NULL AS TEXT) AS mprof,
CAST(NULL AS TEXT) AS mstae,
CAST(NULL AS TEXT) AS mstav,
CAST(NULL AS TEXT) AS mstde,
CAST(NULL AS TEXT) AS mstdv,
CAST(NULL AS TEXT) AS mtart,
CAST(NULL AS TEXT) AS mtpos_mara,
CAST(NULL AS TEXT) AS normt,
CAST(NULL AS TEXT) AS nrfhg,
CAST(NULL AS TEXT) AS nsnid,
CAST(NULL AS DECIMAL(28, 6)) AS ntgew,
CAST(NULL AS TEXT) AS numtp,
CAST(NULL AS TEXT) AS oigroupnam,
CAST(NULL AS TEXT) AS oihmtxgr,
CAST(NULL AS TEXT) AS oitrind,
CAST(NULL AS TEXT) AS packcode,
CAST(NULL AS TEXT) AS picnum,
CAST(NULL AS TEXT) AS pilferable,
CAST(NULL AS TEXT) AS plgtp,
CAST(NULL AS TEXT) AS pmata,
CAST(NULL AS TEXT) AS prdha,
CAST(NULL AS TEXT) AS profl,
CAST(NULL AS TEXT) AS przus,
CAST(NULL AS TEXT) AS ps_smartform,
CAST(NULL AS TEXT) AS psm_code,
CAST(NULL AS TEXT) AS pstat,
CAST(NULL AS TEXT) AS qgrp,
CAST(NULL AS TEXT) AS qmpur,
CAST(NULL AS DECIMAL(28, 6)) AS qqtime,
CAST(NULL AS TEXT) AS qqtimeuom,
CAST(NULL AS TEXT) AS raube,
CAST(NULL AS TEXT) AS rbnrm,
CAST(NULL AS TEXT) AS rdmhd,
CAST(NULL AS TEXT) AS retdelc,
CAST(NULL AS TEXT) AS rmatp,
CAST(NULL AS TEXT) AS saisj,
CAST(NULL AS TEXT) AS saiso,
CAST(NULL AS TEXT) AS saity,
CAST(NULL AS TEXT) AS satnr,
CAST(NULL AS TEXT) AS serial,
CAST(NULL AS TEXT) AS serlv,
CAST(NULL AS TEXT) AS sgt_covsa,
CAST(NULL AS TEXT) AS sgt_csgr,
CAST(NULL AS TEXT) AS sgt_rel,
CAST(NULL AS TEXT) AS sgt_scope,
CAST(NULL AS TEXT) AS sgt_stat,
CAST(NULL AS TEXT) AS size1,
CAST(NULL AS TEXT) AS size1_atinn,
CAST(NULL AS TEXT) AS size2,
CAST(NULL AS TEXT) AS size2_atinn,
CAST(NULL AS TEXT) AS sled_bbd,
CAST(NULL AS TEXT) AS spart,
CAST(NULL AS TEXT) AS sprof,
CAST(NULL AS DECIMAL(28, 6)) AS stfak,
CAST(NULL AS TEXT) AS stoff,
CAST(NULL AS TEXT) AS taklv,
CAST(NULL AS TEXT) AS tare_var,
CAST(NULL AS TEXT) AS tempb,
CAST(NULL AS TEXT) AS textile_comp_ind,
CAST(NULL AS TEXT) AS tragr,
CAST(NULL AS TEXT) AS vabme,
CAST(NULL AS TEXT) AS vhart,
CAST(NULL AS TEXT) AS voleh,
CAST(NULL AS DECIMAL(28, 6)) AS volto,
CAST(NULL AS DECIMAL(28, 6)) AS volum,
CAST(NULL AS DECIMAL(28, 6)) AS vpreh,
CAST(NULL AS TEXT) AS vpsta,
CAST(NULL AS TEXT) AS weora,
CAST(NULL AS DECIMAL(28, 6)) AS wesch,
CAST(NULL AS TEXT) AS whmatgr,
CAST(NULL AS TEXT) AS whstc,
CAST(NULL AS TEXT) AS wrkst,
CAST(NULL AS TEXT) AS xchpf,
CAST(NULL AS TEXT) AS xgchp,
CAST(NULL AS TEXT) AS zeiar,
CAST(NULL AS TEXT) AS zeifo,
CAST(NULL AS TEXT) AS zeinr,
CAST(NULL AS TEXT) AS zeivr
FROM base
), final AS (
SELECT
mandt,
matnr,
ersda,
ernam,
laeda,
aenam,
vpsta,
pstat,
lvorm,
mtart,
mbrsh,
matkl,
bismt,
meins,
bstme,
zeinr,
zeiar,
zeivr,
zeifo,
aeszn,
blatt,
blanz,
ferth,
formt,
groes,
wrkst,
normt,
labor,
ekwsl,
brgew,
ntgew,
gewei,
volum,
voleh,
behvo,
raube,
tempb,
disst,
tragr,
stoff,
spart,
kunnr,
eannr,
wesch,
bwvor,
bwscl,
saiso,
etiar,
etifo,
entar,
ean11,
numtp,
laeng,
breit,
hoehe,
meabm,
prdha,
aeklk,
cadkz,
qmpur,
ergew,
ergei,
ervol,
ervoe,
gewto,
volto,
vabme,
kzrev,
kzkfg,
xchpf,
vhart,
fuelg,
stfak,
magrv,
begru,
datab,
liqdt,
saisj,
plgtp,
mlgut,
extwg,
satnr,
attyp,
kzkup,
kznfm,
pmata,
mstae,
mstav,
mstde,
mstdv,
taklv,
rbnrm,
mhdrz,
mhdhb,
mhdlp,
inhme,
inhal,
vpreh,
etiag,
inhbr,
cmeth,
cuobf,
kzumw,
kosch,
sprof,
nrfhg,
mfrpn,
mfrnr,
bmatn,
mprof,
kzwsm,
saity,
profl,
ihivi,
iloos,
serlv,
kzgvh,
xgchp,
kzeff,
compl,
iprkz,
rdmhd,
przus,
mtpos_mara,
bflme,
nsnid,
_fivetran_rowid,
_fivetran_deleted,
_fivetran_synced
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
matnr | None | Material number |
ersda | None | Created on |
ernam | None | Name of person who created the object |
laeda | None | Date of last change |
aenam | None | Name of person who changed object |
vpsta | None | Maintenance status of complete material |
pstat | None | Maintenance status |
lvorm | None | Flag material for deletion at client level |
mtart | None | Material type |
mbrsh | None | Industry sector |
matkl | None | Material group |
bismt | None | Old material number |
meins | None | Base unit of measure |
bstme | None | Order unit |
zeinr | None | Document number (without document management system) |
zeiar | None | Document type (without document management system) |
zeivr | None | Document version (without document management system) |
zeifo | None | Page form of document (without document management system) |
aeszn | None | Document change number (without document management system) |
blatt | None | Page number of document (without document management system) |
blanz | None | Number of sheets (without document management system) |
ferth | None | Production/inspection memo |
formt | None | Page format of production memo |
groes | None | Size/dimensions |
wrkst | None | Basic material |
normt | None | Industry Standard Description (such as ANSI or ISO) |
labor | None | Laboratory/design office |
ekwsl | None | Purchasing value key |
brgew | None | Gross weight |
ntgew | None | Net weight |
gewei | None | Weight unit |
volum | None | Volume |
voleh | None | Volume unit |
behvo | None | Container requirements |
raube | None | Storage conditions |
tempb | None | Temperature conditions indicator |
disst | None | Low-level code |
tragr | None | Transportation group |
stoff | None | Hazardous material number |
spart | None | Divsion |
kunnr | None | Competitor |
eannr | None | European Article Number (EAN) |
wesch | None | Quantity, or number of GR/GI slips to be printed |
bwvor | None | Procurement rule |
bwscl | None | Source of supply |
saiso | None | Season category |
etiar | None | Label type |
etifo | None | Label form |
entar | None | Disposal type |
ean11 | None | International Article Number (EAN/UPC) |
numtp | None | Category of International Article Number (EAN) |
laeng | None | Length |
breit | None | Width |
hoehe | None | Height |
meabm | None | Unit of dimension for length/width/height |
prdha | None | Product hierarchy |
aeklk | None | Stock transfer net change costing |
cadkz | None | CAD indicator |
qmpur | None | QM in procurement is active |
ergew | None | Allowed packaging weight |
ergei | None | Unit of weight (allowed packaging weight) |
ervol | None | Allowed packaging volume |
ervoe | None | Volume unit (allowed packaging volume) |
gewto | None | Excess weight tolerance for handling unit |
volto | None | Excess volume tolerance of the handling unit |
vabme | None | Variable purchase order unit active |
kzrev | None | Revision level has been assigned to the material |
kzkfg | None | Configurable material |
xchpf | None | Batch management requirement indicator |
vhart | None | Packaging material type |
fuelg | None | Maximum level (by volume) |
stfak | None | Stacking factor |
magrv | None | Material group (Packaging materials) |
begru | None | Authorization group |
datab | None | Valid-from date |
liqdt | None | Deletion date |
saisj | None | Season year |
plgtp | None | Price band category |
mlgut | None | Empties bill of material |
extwg | None | External material group |
satnr | None | Cross-plant configurable material |
attyp | None | Material category |
kzkup | None | Indicator (Material can be co-product) |
kznfm | None | Indicator (The amterial has a follow-up material) |
pmata | None | Pricing reference material |
mstae | None | Cross-plant material status |
mstav | None | Cross-distribution-chain material status |
mstde | None | Date from which the cross-plan material status is valid |
mstdv | None | Date from which the X-distr.-chain material status is valid |
taklv | None | Tax classification of the material |
rbnrm | None | Catalog profile |
mhdrz | None | Minimum remaining shelf life |
mhdhb | None | Total shelf life |
mhdlp | None | Storage percentage |
inhme | None | Content unit |
inhal | None | Net contents |
vpreh | None | Comparison price unit |
etiag | None | IS-R labeling (material grouping) |
inhbr | None | Gross contents |
cmeth | None | Quantity conversion method |
cuobf | None | Internal object number |
kzumw | None | Environmentally relevant |
kosch | None | Product allocation determination procedure |
sprof | None | Pricing profile for variants |
nrfhg | None | Material qualifies for discount in kind |
mfrpn | None | Manufacturer part number |
mfrnr | None | Manufacturer number |
bmatn | None | Number of firm's own (internal) inventory-managed material |
mprof | None | Mfr part profile |
kzwsm | None | Units of measure usage |
saity | None | Rollout in a season |
profl | None | Dangerous goods indicator profile |
ihivi | None | Indicator (highly viscous) |
iloos | None | Indicator (in bulk/liquid) |
serlv | None | Level of explicitness for serial numbers |
kzgvh | None | Packaging material is closed packaging |
xgchp | None | Indicator (Approved batch record required) |
kzeff | None | Assign effectivity parameter values / override change numbers |
compl | None | Material completion level |
iprkz | None | Period indicator for shelf life expiration date |
rdmhd | None | Rounding rule for calculation of SLED |
przus | None | Indicator (Product composition printed on packaging) |
mtpos_mara | None | General item category group |
bflme | None | Generic material with logistical variants |
nsnid | None | NATO item identification number |
MANDT | NUMBER | None |
MATNR | NUMBER | None |
ERSDA | NUMBER | None |
ERNAM | TEXT | None |
LAEDA | NUMBER | None |
AENAM | TEXT | None |
VPSTA | TEXT | None |
PSTAT | TEXT | None |
LVORM | NUMBER | None |
MTART | TEXT | None |
MBRSH | TEXT | None |
MATKL | NUMBER | None |
BISMT | TEXT | None |
MEINS | TEXT | None |
BSTME | NUMBER | None |
ZEINR | NUMBER | None |
ZEIAR | NUMBER | None |
ZEIVR | NUMBER | None |
ZEIFO | NUMBER | None |
AESZN | NUMBER | None |
BLATT | NUMBER | None |
BLANZ | NUMBER | None |
FERTH | NUMBER | None |
FORMT | NUMBER | None |
GROES | NUMBER | None |
WRKST | NUMBER | None |
NORMT | NUMBER | None |
LABOR | NUMBER | None |
EKWSL | NUMBER | None |
BRGEW | NUMBER | None |
NTGEW | NUMBER | None |
GEWEI | NUMBER | None |
VOLUM | NUMBER | None |
VOLEH | NUMBER | None |
BEHVO | NUMBER | None |
RAUBE | NUMBER | None |
TEMPB | NUMBER | None |
DISST | NUMBER | None |
TRAGR | NUMBER | None |
STOFF | NUMBER | None |
SPART | NUMBER | None |
KUNNR | NUMBER | None |
EANNR | NUMBER | None |
WESCH | NUMBER | None |
BWVOR | NUMBER | None |
BWSCL | NUMBER | None |
SAISO | NUMBER | None |
ETIAR | NUMBER | None |
ETIFO | NUMBER | None |
ENTAR | NUMBER | None |
EAN11 | NUMBER | None |
NUMTP | NUMBER | None |
LAENG | NUMBER | None |
BREIT | NUMBER | None |
HOEHE | NUMBER | None |
MEABM | NUMBER | None |
PRDHA | NUMBER | None |
AEKLK | NUMBER | None |
CADKZ | NUMBER | None |
QMPUR | NUMBER | None |
ERGEW | NUMBER | None |
ERGEI | NUMBER | None |
ERVOL | NUMBER | None |
ERVOE | NUMBER | None |
GEWTO | NUMBER | None |
VOLTO | NUMBER | None |
VABME | NUMBER | None |
KZREV | NUMBER | None |
KZKFG | NUMBER | None |
XCHPF | NUMBER | None |
VHART | NUMBER | None |
FUELG | NUMBER | None |
STFAK | NUMBER | None |
MAGRV | NUMBER | None |
BEGRU | NUMBER | None |
DATAB | NUMBER | None |
LIQDT | NUMBER | None |
SAISJ | NUMBER | None |
PLGTP | NUMBER | None |
MLGUT | NUMBER | None |
EXTWG | NUMBER | None |
SATNR | NUMBER | None |
ATTYP | NUMBER | None |
KZKUP | NUMBER | None |
KZNFM | NUMBER | None |
PMATA | NUMBER | None |
MSTAE | NUMBER | None |
MSTAV | NUMBER | None |
MSTDE | NUMBER | None |
MSTDV | NUMBER | None |
TAKLV | NUMBER | None |
RBNRM | NUMBER | None |
MHDRZ | NUMBER | None |
MHDHB | NUMBER | None |
MHDLP | NUMBER | None |
INHME | NUMBER | None |
INHAL | NUMBER | None |
VPREH | NUMBER | None |
ETIAG | NUMBER | None |
INHBR | NUMBER | None |
CMETH | NUMBER | None |
CUOBF | NUMBER | None |
KZUMW | NUMBER | None |
KOSCH | NUMBER | None |
SPROF | NUMBER | None |
NRFHG | NUMBER | None |
MFRPN | NUMBER | None |
MFRNR | NUMBER | None |
BMATN | NUMBER | None |
MPROF | NUMBER | None |
KZWSM | NUMBER | None |
SAITY | NUMBER | None |
PROFL | NUMBER | None |
IHIVI | NUMBER | None |
ILOOS | NUMBER | None |
SERLV | NUMBER | None |
KZGVH | NUMBER | None |
XGCHP | NUMBER | None |
KZEFF | NUMBER | None |
COMPL | NUMBER | None |
IPRKZ | NUMBER | None |
RDMHD | NUMBER | None |
PRZUS | NUMBER | None |
MTPOS_MARA | TEXT | None |
BFLME | NUMBER | None |
NSNID | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query selects all columns and rows from the 'mara' table in the 'sap' schema of the 'TEST' database. It is a simple select all query without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.mara
Name | Type | Comment |
---|---|---|
MANDT | NUMBER | None |
MATNR | NUMBER | None |
ERSDA | NUMBER | None |
ERNAM | TEXT | None |
LAEDA | NUMBER | None |
AENAM | TEXT | None |
VPSTA | TEXT | None |
PSTAT | TEXT | None |
LVORM | NUMBER | None |
MTART | TEXT | None |
MBRSH | TEXT | None |
MATKL | NUMBER | None |
BISMT | TEXT | None |
MEINS | TEXT | None |
BSTME | NUMBER | None |
ZEINR | NUMBER | None |
ZEIAR | NUMBER | None |
ZEIVR | NUMBER | None |
ZEIFO | NUMBER | None |
AESZN | NUMBER | None |
BLATT | NUMBER | None |
BLANZ | NUMBER | None |
FERTH | NUMBER | None |
FORMT | NUMBER | None |
GROES | NUMBER | None |
WRKST | NUMBER | None |
NORMT | NUMBER | None |
LABOR | NUMBER | None |
EKWSL | NUMBER | None |
BRGEW | NUMBER | None |
NTGEW | NUMBER | None |
GEWEI | NUMBER | None |
VOLUM | NUMBER | None |
VOLEH | NUMBER | None |
BEHVO | NUMBER | None |
RAUBE | NUMBER | None |
TEMPB | NUMBER | None |
DISST | NUMBER | None |
TRAGR | NUMBER | None |
STOFF | NUMBER | None |
SPART | NUMBER | None |
KUNNR | NUMBER | None |
EANNR | NUMBER | None |
WESCH | NUMBER | None |
BWVOR | NUMBER | None |
BWSCL | NUMBER | None |
SAISO | NUMBER | None |
ETIAR | NUMBER | None |
ETIFO | NUMBER | None |
ENTAR | NUMBER | None |
EAN11 | NUMBER | None |
NUMTP | NUMBER | None |
LAENG | NUMBER | None |
BREIT | NUMBER | None |
HOEHE | NUMBER | None |
MEABM | NUMBER | None |
PRDHA | NUMBER | None |
AEKLK | NUMBER | None |
CADKZ | NUMBER | None |
QMPUR | NUMBER | None |
ERGEW | NUMBER | None |
ERGEI | NUMBER | None |
ERVOL | NUMBER | None |
ERVOE | NUMBER | None |
GEWTO | NUMBER | None |
VOLTO | NUMBER | None |
VABME | NUMBER | None |
KZREV | NUMBER | None |
KZKFG | NUMBER | None |
XCHPF | NUMBER | None |
VHART | NUMBER | None |
FUELG | NUMBER | None |
STFAK | NUMBER | None |
MAGRV | NUMBER | None |
BEGRU | NUMBER | None |
DATAB | NUMBER | None |
LIQDT | NUMBER | None |
SAISJ | NUMBER | None |
PLGTP | NUMBER | None |
MLGUT | NUMBER | None |
EXTWG | NUMBER | None |
SATNR | NUMBER | None |
ATTYP | NUMBER | None |
KZKUP | NUMBER | None |
KZNFM | NUMBER | None |
PMATA | NUMBER | None |
MSTAE | NUMBER | None |
MSTAV | NUMBER | None |
MSTDE | NUMBER | None |
MSTDV | NUMBER | None |
TAKLV | NUMBER | None |
RBNRM | NUMBER | None |
MHDRZ | NUMBER | None |
MHDHB | NUMBER | None |
MHDLP | NUMBER | None |
INHME | NUMBER | None |
INHAL | NUMBER | None |
VPREH | NUMBER | None |
ETIAG | NUMBER | None |
INHBR | NUMBER | None |
CMETH | NUMBER | None |
CUOBF | NUMBER | None |
KZUMW | NUMBER | None |
KOSCH | NUMBER | None |
SPROF | NUMBER | None |
NRFHG | NUMBER | None |
MFRPN | NUMBER | None |
MFRNR | NUMBER | None |
BMATN | NUMBER | None |
MPROF | NUMBER | None |
KZWSM | NUMBER | None |
SAITY | NUMBER | None |
PROFL | NUMBER | None |
IHIVI | NUMBER | None |
ILOOS | NUMBER | None |
SERLV | NUMBER | None |
KZGVH | NUMBER | None |
XGCHP | NUMBER | None |
KZEFF | NUMBER | None |
COMPL | NUMBER | None |
IPRKZ | NUMBER | None |
RDMHD | NUMBER | None |
PRZUS | NUMBER | None |
MTPOS_MARA | TEXT | None |
BFLME | NUMBER | None |
NSNID | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a simple data transformation on the 'stg_sap__pa0000_tmp' table. It starts by selecting all columns from the base table, then explicitly casts each column to a specific data type in the 'fields' CTE. Finally, it selects a subset of these columns in a specific order in the 'final' CTE. The query doesn't perform any filtering, aggregation, or complex transformations.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__pa0000_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS aedtm,
CAST(NULL AS TEXT) AS begda,
CAST(NULL AS TEXT) AS endda,
CAST(NULL AS TEXT) AS flag1,
CAST(NULL AS TEXT) AS flag2,
CAST(NULL AS TEXT) AS flag3,
CAST(NULL AS TEXT) AS flag4,
CAST(NULL AS TEXT) AS grpvl,
CAST(NULL AS TEXT) AS histo,
CAST(NULL AS TEXT) AS itbld,
CAST(NULL AS TEXT) AS itxex,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS massg,
CAST(NULL AS TEXT) AS massn,
CAST(NULL AS TEXT) AS objps,
CAST(NULL AS TEXT) AS ordex,
CAST(NULL AS TEXT) AS pernr,
CAST(NULL AS TEXT) AS preas,
CAST(NULL AS TEXT) AS refex,
CAST(NULL AS TEXT) AS rese1,
CAST(NULL AS TEXT) AS rese2,
CAST(NULL AS TEXT) AS seqnr,
CAST(NULL AS TEXT) AS sprps,
CAST(NULL AS TEXT) AS stat1,
CAST(NULL AS TEXT) AS stat2,
CAST(NULL AS TEXT) AS stat3,
CAST(NULL AS TEXT) AS subty,
CAST(NULL AS TEXT) AS uname
FROM base
), final AS (
SELECT
mandt,
pernr,
subty,
objps,
sprps,
endda,
begda,
seqnr,
aedtm,
flag1,
flag2,
flag3,
flag4,
grpvl,
histo,
itbld,
itxex,
massg,
massn,
ordex,
preas,
refex,
rese1,
rese2,
stat1,
stat2,
stat3,
uname
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
pernr | None | Personnel number |
subty | None | Subtype |
objps | None | Object identification |
sprps | None | Lock indicator for HR master data record |
begda | None | Start date |
endda | None | End date |
seqnr | None | Number of infotype record with same key |
aedtm | None | Last changed on |
flag1 | None | Reserved field/Unused field |
flag2 | None | Reserved field/Unused field |
flag3 | None | Reserved field/Unused field |
flag4 | None | Reserved field/Unused field |
grpvl | None | Grouping value for personnel assignments |
histo | None | Historical record flag |
itbld | None | Infotype screen control |
itxex | None | Text exists for infotype |
massg | None | Reason for action |
massn | None | Action type |
ordex | None | Confirmation fields exist |
preas | None | Reason for changing master data |
refex | None | Reference fields exist (primary/secondary costs) |
rese1 | None | Reserved field/unused field of length 2 |
rese2 | None | Reserved field/unused field of length 2 |
stat1 | None | Customer-specific status |
stat2 | None | Employment status |
stat3 | None | Special payment status |
uname | None | Name of person who changed object |
MANDT | TEXT | None |
PERNR | TEXT | None |
SUBTY | TEXT | None |
OBJPS | TEXT | None |
SPRPS | TEXT | None |
ENDDA | TEXT | None |
BEGDA | TEXT | None |
SEQNR | TEXT | None |
AEDTM | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
GRPVL | TEXT | None |
HISTO | TEXT | None |
ITBLD | TEXT | None |
ITXEX | TEXT | None |
MASSG | TEXT | None |
MASSN | TEXT | None |
ORDEX | TEXT | None |
PREAS | TEXT | None |
REFEX | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
STAT1 | TEXT | None |
STAT2 | TEXT | None |
STAT3 | TEXT | None |
UNAME | TEXT | None |
This SQL query selects all columns and rows from the table 'pa0000' in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformations, or joins.
OtherSELECT
*
FROM TEST.sap.pa0000
Name | Type | Comment |
---|---|---|
BEGDA | TEXT | None |
ENDDA | TEXT | None |
MANDT | TEXT | None |
OBJPS | TEXT | None |
PERNR | TEXT | None |
SEQNR | TEXT | None |
SPRPS | TEXT | None |
SUBTY | TEXT | None |
AEDTM | TEXT | None |
UNAME | TEXT | None |
HISTO | TEXT | None |
ITXEX | TEXT | None |
REFEX | TEXT | None |
ORDEX | TEXT | None |
ITBLD | TEXT | None |
PREAS | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
GRPVL | TEXT | None |
MASSN | TEXT | None |
MASSG | TEXT | None |
STAT1 | TEXT | None |
STAT2 | TEXT | None |
STAT3 | TEXT | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a data transformation and type casting operation on the 'stg_sap__pa0001_tmp' table. It explicitly casts all columns to specific data types, including setting some fields to NULL. The query then selects a subset of these transformed columns in the final output, effectively creating a standardized view of the data with consistent data types.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__pa0001_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS abkrs,
CAST(NULL AS TEXT) AS aedtm,
CAST(NULL AS TEXT) AS ansvh,
CAST(NULL AS TEXT) AS begda,
CAST(NULL AS TEXT) AS btrtl,
CAST(NULL AS TEXT) AS budget_pd,
CAST(NULL AS TEXT) AS bukrs,
CAST(NULL AS TEXT) AS ename,
CAST(NULL AS TEXT) AS endda,
CAST(NULL AS TEXT) AS fistl,
CAST(NULL AS TEXT) AS fkber,
CAST(NULL AS TEXT) AS flag1,
CAST(NULL AS TEXT) AS flag2,
CAST(NULL AS TEXT) AS flag3,
CAST(NULL AS TEXT) AS flag4,
CAST(NULL AS TEXT) AS geber,
CAST(NULL AS TEXT) AS grant_nbr,
CAST(NULL AS TEXT) AS grpvl,
CAST(NULL AS TEXT) AS gsber,
CAST(NULL AS TEXT) AS histo,
CAST(NULL AS TEXT) AS itbld,
CAST(NULL AS TEXT) AS itxex,
CAST(NULL AS TEXT) AS juper,
CAST(NULL AS TEXT) AS kokrs,
CAST(NULL AS TEXT) AS kostl,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mstbr,
CAST(NULL AS TEXT) AS objps,
CAST(NULL AS TEXT) AS ordex,
CAST(NULL AS TEXT) AS orgeh,
CAST(NULL AS TEXT) AS otype,
CAST(NULL AS TEXT) AS pernr,
CAST(NULL AS TEXT) AS persg,
CAST(NULL AS TEXT) AS persk,
CAST(NULL AS TEXT) AS plans,
CAST(NULL AS TEXT) AS preas,
CAST(NULL AS TEXT) AS refex,
CAST(NULL AS TEXT) AS rese1,
CAST(NULL AS TEXT) AS rese2,
CAST(NULL AS TEXT) AS sacha,
CAST(NULL AS TEXT) AS sachp,
CAST(NULL AS TEXT) AS sachz,
CAST(NULL AS TEXT) AS sbmod,
CAST(NULL AS TEXT) AS seqnr,
CAST(NULL AS TEXT) AS sgmnt,
CAST(NULL AS TEXT) AS sname,
CAST(NULL AS TEXT) AS sprps,
CAST(NULL AS TEXT) AS stell,
CAST(NULL AS TEXT) AS subty,
CAST(NULL AS TEXT) AS uname,
CAST(NULL AS TEXT) AS vdsk1,
CAST(NULL AS TEXT) AS werks
FROM base
), final AS (
SELECT
mandt,
pernr,
subty,
objps,
sprps,
endda,
begda,
seqnr,
abkrs,
aedtm,
ansvh,
btrtl,
budget_pd,
bukrs,
ename,
fistl,
fkber,
flag1,
flag2,
flag3,
flag4,
geber,
grant_nbr,
grpvl,
gsber,
histo,
itbld,
itxex,
juper,
kokrs,
kostl,
mstbr,
ordex,
orgeh,
otype,
persg,
persk,
plans,
preas,
refex,
rese1,
rese2,
sacha,
sachp,
sachz,
sbmod,
sgmnt,
sname,
stell,
uname,
vdsk1,
werks
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
pernr | None | Personnel number |
subty | None | Subtype |
objps | None | Object identification |
sprps | None | Lock indicator for HR master data record |
begda | None | Start date |
endda | None | End date |
seqnr | None | Number of infotype record with same key |
abkrs | None | Payroll area |
aedtm | None | Changed on |
ansvh | None | Work contract |
btrtl | None | Personnel subarea |
budget_pd | None | FM--Budget period |
bukrs | None | Company code |
ename | None | Formatted name of employee or applicant |
fistl | None | Funds center |
fkber | None | Functional area |
flag1 | None | Reserved field/unused field |
flag2 | None | Reserved field/unused field |
flag3 | None | Reserved field/unused field |
flag4 | None | Reserved field/unused field |
geber | None | Fund |
grant_nbr | None | Grant |
grpvl | None | Grouping value for personnel assignments |
gsber | None | Business area |
histo | None | Historical record flag |
itbld | None | Infotype screen control |
itxex | None | Text exists for infotype |
juper | None | Legal person |
kokrs | None | Controlling area |
kostl | None | Cost center |
mstbr | None | Supervisor area |
ordex | None | Confirmation fields exist |
orgeh | None | Organizational unit |
otype | None | Object type |
persg | None | Employee group |
persk | None | Employee subgroup |
plans | None | Position |
preas | None | Reason for changing master data |
refex | None | Reference fields exist (primary/secondary costs) |
rese1 | None | Reserved field/unused field of length 2 |
rese2 | None | Reserved field/unused field of length 2 |
sacha | None | Payroll administrator |
sachp | None | Administrator for HR master data |
sachz | None | Administrator for time recording |
sbmod | None | Administrator group |
sgmnt | None | Segment for segmental reporting |
sname | None | Employee's name (Sortable by LAST NAME FIRST NAME) |
stell | None | Job |
uname | None | Name of person who changed object |
vdsk1 | None | Organizational key |
werks | None | Personnel area |
MANDT | TEXT | None |
PERNR | TEXT | None |
SUBTY | TEXT | None |
OBJPS | TEXT | None |
SPRPS | TEXT | None |
ENDDA | TEXT | None |
BEGDA | TEXT | None |
SEQNR | TEXT | None |
ABKRS | TEXT | None |
AEDTM | TEXT | None |
ANSVH | TEXT | None |
BTRTL | TEXT | None |
BUDGET_PD | TEXT | None |
BUKRS | TEXT | None |
ENAME | TEXT | None |
FISTL | TEXT | None |
FKBER | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
GEBER | TEXT | None |
GRANT_NBR | TEXT | None |
GRPVL | TEXT | None |
GSBER | TEXT | None |
HISTO | TEXT | None |
ITBLD | TEXT | None |
ITXEX | TEXT | None |
JUPER | TEXT | None |
KOKRS | TEXT | None |
KOSTL | TEXT | None |
MSTBR | TEXT | None |
ORDEX | TEXT | None |
ORGEH | TEXT | None |
OTYPE | TEXT | None |
PERSG | TEXT | None |
PERSK | TEXT | None |
PLANS | TEXT | None |
PREAS | TEXT | None |
REFEX | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
SACHA | TEXT | None |
SACHP | TEXT | None |
SACHZ | TEXT | None |
SBMOD | TEXT | None |
SGMNT | TEXT | None |
SNAME | TEXT | None |
STELL | TEXT | None |
UNAME | TEXT | None |
VDSK1 | TEXT | None |
WERKS | TEXT | None |
This SQL query selects all columns and rows from the table 'pa0001' in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.pa0001
Name | Type | Comment |
---|---|---|
BEGDA | TEXT | None |
ENDDA | TEXT | None |
MANDT | TEXT | None |
OBJPS | TEXT | None |
PERNR | TEXT | None |
SEQNR | TEXT | None |
SPRPS | TEXT | None |
SUBTY | TEXT | None |
AEDTM | TEXT | None |
UNAME | TEXT | None |
HISTO | TEXT | None |
ITXEX | TEXT | None |
REFEX | TEXT | None |
ORDEX | TEXT | None |
ITBLD | TEXT | None |
PREAS | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
GRPVL | TEXT | None |
BUKRS | TEXT | None |
WERKS | TEXT | None |
PERSG | TEXT | None |
PERSK | TEXT | None |
VDSK1 | TEXT | None |
GSBER | TEXT | None |
BTRTL | TEXT | None |
JUPER | TEXT | None |
ABKRS | TEXT | None |
ANSVH | TEXT | None |
KOSTL | TEXT | None |
ORGEH | TEXT | None |
PLANS | TEXT | None |
STELL | TEXT | None |
MSTBR | TEXT | None |
SACHA | TEXT | None |
SACHP | TEXT | None |
SACHZ | TEXT | None |
SNAME | TEXT | None |
ENAME | TEXT | None |
OTYPE | TEXT | None |
SBMOD | TEXT | None |
KOKRS | TEXT | None |
FISTL | TEXT | None |
GEBER | TEXT | None |
FKBER | TEXT | None |
GRANT_NBR | TEXT | None |
SGMNT | TEXT | None |
BUDGET_PD | TEXT | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a data type casting operation on a temporary staging table for SAP PA0007 data. It creates a CTE named 'fields' where all columns are cast to specific data types (BOOLEAN, DECIMAL, TIMESTAMP, TEXT). The query then selects all columns from this CTE in a specific order, effectively standardizing the data types and structure of the output.
CleaningOtherWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__pa0007_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS aedtm,
CAST(NULL AS DECIMAL(28, 6)) AS arbst,
CAST(NULL AS TEXT) AS awtyp,
CAST(NULL AS TEXT) AS begda,
CAST(NULL AS TEXT) AS dysch,
CAST(NULL AS DECIMAL(28, 6)) AS empct,
CAST(NULL AS TEXT) AS endda,
CAST(NULL AS TEXT) AS flag1,
CAST(NULL AS TEXT) AS flag2,
CAST(NULL AS TEXT) AS flag3,
CAST(NULL AS TEXT) AS flag4,
CAST(NULL AS TEXT) AS grpvl,
CAST(NULL AS TEXT) AS histo,
CAST(NULL AS TEXT) AS itbld,
CAST(NULL AS TEXT) AS itxex,
CAST(NULL AS DECIMAL(28, 6)) AS jrstd,
CAST(NULL AS TEXT) AS kztim,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS DECIMAL(28, 6)) AS maxja,
CAST(NULL AS DECIMAL(28, 6)) AS maxmo,
CAST(NULL AS DECIMAL(28, 6)) AS maxta,
CAST(NULL AS DECIMAL(28, 6)) AS maxwo,
CAST(NULL AS DECIMAL(28, 6)) AS minja,
CAST(NULL AS DECIMAL(28, 6)) AS minmo,
CAST(NULL AS DECIMAL(28, 6)) AS minta,
CAST(NULL AS DECIMAL(28, 6)) AS minwo,
CAST(NULL AS DECIMAL(28, 6)) AS mostd,
CAST(NULL AS TEXT) AS objps,
CAST(NULL AS TEXT) AS ordex,
CAST(NULL AS TEXT) AS pernr,
CAST(NULL AS TEXT) AS preas,
CAST(NULL AS TEXT) AS refex,
CAST(NULL AS TEXT) AS rese1,
CAST(NULL AS TEXT) AS rese2,
CAST(NULL AS TEXT) AS schkz,
CAST(NULL AS TEXT) AS seqnr,
CAST(NULL AS TEXT) AS sprps,
CAST(NULL AS TEXT) AS subty,
CAST(NULL AS TEXT) AS teilk,
CAST(NULL AS TEXT) AS uname,
CAST(NULL AS DECIMAL(28, 6)) AS wkwdy,
CAST(NULL AS DECIMAL(28, 6)) AS wostd,
CAST(NULL AS TEXT) AS wweek,
CAST(NULL AS TEXT) AS zterf
FROM base
), final AS (
SELECT
mandt,
pernr,
subty,
objps,
sprps,
endda,
begda,
seqnr,
aedtm,
arbst,
awtyp,
dysch,
empct,
flag1,
flag2,
flag3,
flag4,
grpvl,
histo,
itbld,
itxex,
jrstd,
kztim,
maxja,
maxmo,
maxta,
maxwo,
minja,
minmo,
minta,
minwo,
mostd,
ordex,
preas,
refex,
rese1,
rese2,
schkz,
teilk,
uname,
wkwdy,
wostd,
wweek,
zterf
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
pernr | None | Personnel number |
subty | None | Subtype |
objps | None | Object identification |
sprps | None | Lock indicator for HR master data record |
begda | None | Start date |
endda | None | End date |
seqnr | None | Number of infotype record with same key |
aedtm | None | Changed on |
arbst | None | Daily working hours |
awtyp | None | Reference transaction |
dysch | None | Create daily work schedule dynamically |
empct | None | Employment percentage |
flag1 | None | Reserved field/unused field |
flag2 | None | Reserved field/unused field |
flag3 | None | Reserved field/unused field |
flag4 | None | Reserved field/unused field |
grpvl | None | Grouping value for personnel assignments |
histo | None | Historical record flag |
itbld | None | Infotype screen control |
itxex | None | Text exists for infotype |
jrstd | None | Annual working hours |
kztim | None | Additional indicator for time management |
maxja | None | Maximum number of working hours per year |
maxmo | None | Maximum number of work hours per month |
maxta | None | Maximum number of work hours per day |
maxwo | None | Maximum number of work hours per week |
minja | None | Minimum annual working hours |
minmo | None | Minimum number of work hours per month |
minta | None | Minimum number of work hours per day |
minwo | None | Minimum weekly working hours |
mostd | None | Monthly hours |
ordex | None | Confirmation fields exist |
preas | None | Reason for changing master data |
refex | None | Reference fields exist (primary/secondary costs) |
rese1 | None | Reserved field/unused field of length 2 |
rese2 | None | Reserved field/unused field of length 2 |
schkz | None | Work schedule rule |
teilk | None | Indicator part-time employee |
uname | None | Name of person who changed objects |
wkwdy | None | Weekly workdays |
wostd | None | Hours per week |
wweek | None | Working week |
zterf | None | Employee time management status |
MANDT | TEXT | None |
PERNR | TEXT | None |
SUBTY | TEXT | None |
OBJPS | TEXT | None |
SPRPS | TEXT | None |
ENDDA | TEXT | None |
BEGDA | TEXT | None |
SEQNR | TEXT | None |
AEDTM | TEXT | None |
ARBST | NUMBER | None |
AWTYP | TEXT | None |
DYSCH | TEXT | None |
EMPCT | NUMBER | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
GRPVL | TEXT | None |
HISTO | TEXT | None |
ITBLD | TEXT | None |
ITXEX | TEXT | None |
JRSTD | NUMBER | None |
KZTIM | TEXT | None |
MAXJA | NUMBER | None |
MAXMO | NUMBER | None |
MAXTA | NUMBER | None |
MAXWO | NUMBER | None |
MINJA | NUMBER | None |
MINMO | NUMBER | None |
MINTA | NUMBER | None |
MINWO | NUMBER | None |
MOSTD | NUMBER | None |
ORDEX | TEXT | None |
PREAS | TEXT | None |
REFEX | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
SCHKZ | TEXT | None |
TEILK | TEXT | None |
UNAME | TEXT | None |
WKWDY | NUMBER | None |
WOSTD | NUMBER | None |
WWEEK | TEXT | None |
ZTERF | TEXT | None |
This SQL query selects all columns and rows from the table 'pa0007' in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.pa0007
Name | Type | Comment |
---|---|---|
BEGDA | TEXT | None |
ENDDA | TEXT | None |
MANDT | TEXT | None |
OBJPS | TEXT | None |
PERNR | TEXT | None |
SEQNR | TEXT | None |
SPRPS | TEXT | None |
SUBTY | TEXT | None |
AEDTM | TEXT | None |
UNAME | TEXT | None |
HISTO | TEXT | None |
ITXEX | TEXT | None |
REFEX | TEXT | None |
ORDEX | TEXT | None |
ITBLD | TEXT | None |
PREAS | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
GRPVL | TEXT | None |
SCHKZ | TEXT | None |
ZTERF | TEXT | None |
EMPCT | NUMBER | None |
MOSTD | NUMBER | None |
WOSTD | NUMBER | None |
ARBST | NUMBER | None |
WKWDY | NUMBER | None |
JRSTD | NUMBER | None |
TEILK | TEXT | None |
MINTA | NUMBER | None |
MAXTA | NUMBER | None |
MINWO | NUMBER | None |
MAXWO | NUMBER | None |
MINMO | NUMBER | None |
MAXMO | NUMBER | None |
MINJA | NUMBER | None |
MAXJA | NUMBER | None |
DYSCH | TEXT | None |
KZTIM | TEXT | None |
WWEEK | TEXT | None |
AWTYP | TEXT | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a data type casting operation on a staging table. It selects all columns from a temporary table, casts them to specific data types (such as BOOLEAN, DECIMAL, TIMESTAMP, and TEXT), and then selects a subset of these cast columns in a specific order for the final output. The query doesn't filter, transform, or aggregate the data beyond these casting operations.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__pa0008_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS aedtm,
CAST(NULL AS TEXT) AS ancur,
CAST(NULL AS DECIMAL(28, 6)) AS ansal,
CAST(NULL AS DECIMAL(28, 6)) AS anz01,
CAST(NULL AS DECIMAL(28, 6)) AS anz02,
CAST(NULL AS DECIMAL(28, 6)) AS anz03,
CAST(NULL AS DECIMAL(28, 6)) AS anz04,
CAST(NULL AS DECIMAL(28, 6)) AS anz05,
CAST(NULL AS DECIMAL(28, 6)) AS anz06,
CAST(NULL AS DECIMAL(28, 6)) AS anz07,
CAST(NULL AS DECIMAL(28, 6)) AS anz08,
CAST(NULL AS DECIMAL(28, 6)) AS anz09,
CAST(NULL AS DECIMAL(28, 6)) AS anz10,
CAST(NULL AS DECIMAL(28, 6)) AS anz11,
CAST(NULL AS DECIMAL(28, 6)) AS anz12,
CAST(NULL AS DECIMAL(28, 6)) AS anz13,
CAST(NULL AS DECIMAL(28, 6)) AS anz14,
CAST(NULL AS DECIMAL(28, 6)) AS anz15,
CAST(NULL AS DECIMAL(28, 6)) AS anz16,
CAST(NULL AS DECIMAL(28, 6)) AS anz17,
CAST(NULL AS DECIMAL(28, 6)) AS anz18,
CAST(NULL AS DECIMAL(28, 6)) AS anz19,
CAST(NULL AS DECIMAL(28, 6)) AS anz20,
CAST(NULL AS DECIMAL(28, 6)) AS anz21,
CAST(NULL AS DECIMAL(28, 6)) AS anz22,
CAST(NULL AS DECIMAL(28, 6)) AS anz23,
CAST(NULL AS DECIMAL(28, 6)) AS anz24,
CAST(NULL AS DECIMAL(28, 6)) AS anz25,
CAST(NULL AS DECIMAL(28, 6)) AS anz26,
CAST(NULL AS DECIMAL(28, 6)) AS anz27,
CAST(NULL AS DECIMAL(28, 6)) AS anz28,
CAST(NULL AS DECIMAL(28, 6)) AS anz29,
CAST(NULL AS DECIMAL(28, 6)) AS anz30,
CAST(NULL AS DECIMAL(28, 6)) AS anz31,
CAST(NULL AS DECIMAL(28, 6)) AS anz32,
CAST(NULL AS DECIMAL(28, 6)) AS anz33,
CAST(NULL AS DECIMAL(28, 6)) AS anz34,
CAST(NULL AS DECIMAL(28, 6)) AS anz35,
CAST(NULL AS DECIMAL(28, 6)) AS anz36,
CAST(NULL AS DECIMAL(28, 6)) AS anz37,
CAST(NULL AS DECIMAL(28, 6)) AS anz38,
CAST(NULL AS DECIMAL(28, 6)) AS anz39,
CAST(NULL AS DECIMAL(28, 6)) AS anz40,
CAST(NULL AS TEXT) AS begda,
CAST(NULL AS DECIMAL(28, 6)) AS bet01,
CAST(NULL AS DECIMAL(28, 6)) AS bet02,
CAST(NULL AS DECIMAL(28, 6)) AS bet03,
CAST(NULL AS DECIMAL(28, 6)) AS bet04,
CAST(NULL AS DECIMAL(28, 6)) AS bet05,
CAST(NULL AS DECIMAL(28, 6)) AS bet06,
CAST(NULL AS DECIMAL(28, 6)) AS bet07,
CAST(NULL AS DECIMAL(28, 6)) AS bet08,
CAST(NULL AS DECIMAL(28, 6)) AS bet09,
CAST(NULL AS DECIMAL(28, 6)) AS bet10,
CAST(NULL AS DECIMAL(28, 6)) AS bet11,
CAST(NULL AS DECIMAL(28, 6)) AS bet12,
CAST(NULL AS DECIMAL(28, 6)) AS bet13,
CAST(NULL AS DECIMAL(28, 6)) AS bet14,
CAST(NULL AS DECIMAL(28, 6)) AS bet15,
CAST(NULL AS DECIMAL(28, 6)) AS bet16,
CAST(NULL AS DECIMAL(28, 6)) AS bet17,
CAST(NULL AS DECIMAL(28, 6)) AS bet18,
CAST(NULL AS DECIMAL(28, 6)) AS bet19,
CAST(NULL AS DECIMAL(28, 6)) AS bet20,
CAST(NULL AS DECIMAL(28, 6)) AS bet21,
CAST(NULL AS DECIMAL(28, 6)) AS bet22,
CAST(NULL AS DECIMAL(28, 6)) AS bet23,
CAST(NULL AS DECIMAL(28, 6)) AS bet24,
CAST(NULL AS DECIMAL(28, 6)) AS bet25,
CAST(NULL AS DECIMAL(28, 6)) AS bet26,
CAST(NULL AS DECIMAL(28, 6)) AS bet27,
CAST(NULL AS DECIMAL(28, 6)) AS bet28,
CAST(NULL AS DECIMAL(28, 6)) AS bet29,
CAST(NULL AS DECIMAL(28, 6)) AS bet30,
CAST(NULL AS DECIMAL(28, 6)) AS bet31,
CAST(NULL AS DECIMAL(28, 6)) AS bet32,
CAST(NULL AS DECIMAL(28, 6)) AS bet33,
CAST(NULL AS DECIMAL(28, 6)) AS bet34,
CAST(NULL AS DECIMAL(28, 6)) AS bet35,
CAST(NULL AS DECIMAL(28, 6)) AS bet36,
CAST(NULL AS DECIMAL(28, 6)) AS bet37,
CAST(NULL AS DECIMAL(28, 6)) AS bet38,
CAST(NULL AS DECIMAL(28, 6)) AS bet39,
CAST(NULL AS DECIMAL(28, 6)) AS bet40,
CAST(NULL AS DECIMAL(28, 6)) AS bsgrd,
CAST(NULL AS TEXT) AS cpind,
CAST(NULL AS DECIMAL(28, 6)) AS divgv,
CAST(NULL AS TEXT) AS ein01,
CAST(NULL AS TEXT) AS ein02,
CAST(NULL AS TEXT) AS ein03,
CAST(NULL AS TEXT) AS ein04,
CAST(NULL AS TEXT) AS ein05,
CAST(NULL AS TEXT) AS ein06,
CAST(NULL AS TEXT) AS ein07,
CAST(NULL AS TEXT) AS ein08,
CAST(NULL AS TEXT) AS ein09,
CAST(NULL AS TEXT) AS ein10,
CAST(NULL AS TEXT) AS ein11,
CAST(NULL AS TEXT) AS ein12,
CAST(NULL AS TEXT) AS ein13,
CAST(NULL AS TEXT) AS ein14,
CAST(NULL AS TEXT) AS ein15,
CAST(NULL AS TEXT) AS ein16,
CAST(NULL AS TEXT) AS ein17,
CAST(NULL AS TEXT) AS ein18,
CAST(NULL AS TEXT) AS ein19,
CAST(NULL AS TEXT) AS ein20,
CAST(NULL AS TEXT) AS ein21,
CAST(NULL AS TEXT) AS ein22,
CAST(NULL AS TEXT) AS ein23,
CAST(NULL AS TEXT) AS ein24,
CAST(NULL AS TEXT) AS ein25,
CAST(NULL AS TEXT) AS ein26,
CAST(NULL AS TEXT) AS ein27,
CAST(NULL AS TEXT) AS ein28,
CAST(NULL AS TEXT) AS ein29,
CAST(NULL AS TEXT) AS ein30,
CAST(NULL AS TEXT) AS ein31,
CAST(NULL AS TEXT) AS ein32,
CAST(NULL AS TEXT) AS ein33,
CAST(NULL AS TEXT) AS ein34,
CAST(NULL AS TEXT) AS ein35,
CAST(NULL AS TEXT) AS ein36,
CAST(NULL AS TEXT) AS ein37,
CAST(NULL AS TEXT) AS ein38,
CAST(NULL AS TEXT) AS ein39,
CAST(NULL AS TEXT) AS ein40,
CAST(NULL AS TEXT) AS endda,
CAST(NULL AS TEXT) AS falgk,
CAST(NULL AS TEXT) AS falgr,
CAST(NULL AS TEXT) AS flag1,
CAST(NULL AS TEXT) AS flag2,
CAST(NULL AS TEXT) AS flag3,
CAST(NULL AS TEXT) AS flag4,
CAST(NULL AS TEXT) AS flaga,
CAST(NULL AS TEXT) AS grpvl,
CAST(NULL AS TEXT) AS histo,
CAST(NULL AS TEXT) AS ind01,
CAST(NULL AS TEXT) AS ind02,
CAST(NULL AS TEXT) AS ind03,
CAST(NULL AS TEXT) AS ind04,
CAST(NULL AS TEXT) AS ind05,
CAST(NULL AS TEXT) AS ind06,
CAST(NULL AS TEXT) AS ind07,
CAST(NULL AS TEXT) AS ind08,
CAST(NULL AS TEXT) AS ind09,
CAST(NULL AS TEXT) AS ind10,
CAST(NULL AS TEXT) AS ind11,
CAST(NULL AS TEXT) AS ind12,
CAST(NULL AS TEXT) AS ind13,
CAST(NULL AS TEXT) AS ind14,
CAST(NULL AS TEXT) AS ind15,
CAST(NULL AS TEXT) AS ind16,
CAST(NULL AS TEXT) AS ind17,
CAST(NULL AS TEXT) AS ind18,
CAST(NULL AS TEXT) AS ind19,
CAST(NULL AS TEXT) AS ind20,
CAST(NULL AS TEXT) AS ind21,
CAST(NULL AS TEXT) AS ind22,
CAST(NULL AS TEXT) AS ind23,
CAST(NULL AS TEXT) AS ind24,
CAST(NULL AS TEXT) AS ind25,
CAST(NULL AS TEXT) AS ind26,
CAST(NULL AS TEXT) AS ind27,
CAST(NULL AS TEXT) AS ind28,
CAST(NULL AS TEXT) AS ind29,
CAST(NULL AS TEXT) AS ind30,
CAST(NULL AS TEXT) AS ind31,
CAST(NULL AS TEXT) AS ind32,
CAST(NULL AS TEXT) AS ind33,
CAST(NULL AS TEXT) AS ind34,
CAST(NULL AS TEXT) AS ind35,
CAST(NULL AS TEXT) AS ind36,
CAST(NULL AS TEXT) AS ind37,
CAST(NULL AS TEXT) AS ind38,
CAST(NULL AS TEXT) AS ind39,
CAST(NULL AS TEXT) AS ind40,
CAST(NULL AS TEXT) AS itbld,
CAST(NULL AS TEXT) AS itxex,
CAST(NULL AS TEXT) AS lga01,
CAST(NULL AS TEXT) AS lga02,
CAST(NULL AS TEXT) AS lga03,
CAST(NULL AS TEXT) AS lga04,
CAST(NULL AS TEXT) AS lga05,
CAST(NULL AS TEXT) AS lga06,
CAST(NULL AS TEXT) AS lga07,
CAST(NULL AS TEXT) AS lga08,
CAST(NULL AS TEXT) AS lga09,
CAST(NULL AS TEXT) AS lga10,
CAST(NULL AS TEXT) AS lga11,
CAST(NULL AS TEXT) AS lga12,
CAST(NULL AS TEXT) AS lga13,
CAST(NULL AS TEXT) AS lga14,
CAST(NULL AS TEXT) AS lga15,
CAST(NULL AS TEXT) AS lga16,
CAST(NULL AS TEXT) AS lga17,
CAST(NULL AS TEXT) AS lga18,
CAST(NULL AS TEXT) AS lga19,
CAST(NULL AS TEXT) AS lga20,
CAST(NULL AS TEXT) AS lga21,
CAST(NULL AS TEXT) AS lga22,
CAST(NULL AS TEXT) AS lga23,
CAST(NULL AS TEXT) AS lga24,
CAST(NULL AS TEXT) AS lga25,
CAST(NULL AS TEXT) AS lga26,
CAST(NULL AS TEXT) AS lga27,
CAST(NULL AS TEXT) AS lga28,
CAST(NULL AS TEXT) AS lga29,
CAST(NULL AS TEXT) AS lga30,
CAST(NULL AS TEXT) AS lga31,
CAST(NULL AS TEXT) AS lga32,
CAST(NULL AS TEXT) AS lga33,
CAST(NULL AS TEXT) AS lga34,
CAST(NULL AS TEXT) AS lga35,
CAST(NULL AS TEXT) AS lga36,
CAST(NULL AS TEXT) AS lga37,
CAST(NULL AS TEXT) AS lga38,
CAST(NULL AS TEXT) AS lga39,
CAST(NULL AS TEXT) AS lga40,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS objps,
CAST(NULL AS TEXT) AS opk01,
CAST(NULL AS TEXT) AS opk02,
CAST(NULL AS TEXT) AS opk03,
CAST(NULL AS TEXT) AS opk04,
CAST(NULL AS TEXT) AS opk05,
CAST(NULL AS TEXT) AS opk06,
CAST(NULL AS TEXT) AS opk07,
CAST(NULL AS TEXT) AS opk08,
CAST(NULL AS TEXT) AS opk09,
CAST(NULL AS TEXT) AS opk10,
CAST(NULL AS TEXT) AS opk11,
CAST(NULL AS TEXT) AS opk12,
CAST(NULL AS TEXT) AS opk13,
CAST(NULL AS TEXT) AS opk14,
CAST(NULL AS TEXT) AS opk15,
CAST(NULL AS TEXT) AS opk16,
CAST(NULL AS TEXT) AS opk17,
CAST(NULL AS TEXT) AS opk18,
CAST(NULL AS TEXT) AS opk19,
CAST(NULL AS TEXT) AS opk20,
CAST(NULL AS TEXT) AS opk21,
CAST(NULL AS TEXT) AS opk22,
CAST(NULL AS TEXT) AS opk23,
CAST(NULL AS TEXT) AS opk24,
CAST(NULL AS TEXT) AS opk25,
CAST(NULL AS TEXT) AS opk26,
CAST(NULL AS TEXT) AS opk27,
CAST(NULL AS TEXT) AS opk28,
CAST(NULL AS TEXT) AS opk29,
CAST(NULL AS TEXT) AS opk30,
CAST(NULL AS TEXT) AS opk31,
CAST(NULL AS TEXT) AS opk32,
CAST(NULL AS TEXT) AS opk33,
CAST(NULL AS TEXT) AS opk34,
CAST(NULL AS TEXT) AS opk35,
CAST(NULL AS TEXT) AS opk36,
CAST(NULL AS TEXT) AS opk37,
CAST(NULL AS TEXT) AS opk38,
CAST(NULL AS TEXT) AS opk39,
CAST(NULL AS TEXT) AS opk40,
CAST(NULL AS TEXT) AS ordex,
CAST(NULL AS TEXT) AS orzst,
CAST(NULL AS TEXT) AS partn,
CAST(NULL AS TEXT) AS pernr,
CAST(NULL AS TEXT) AS preas,
CAST(NULL AS TEXT) AS refex,
CAST(NULL AS TEXT) AS rese1,
CAST(NULL AS TEXT) AS rese2,
CAST(NULL AS TEXT) AS seqnr,
CAST(NULL AS TEXT) AS sprps,
CAST(NULL AS TEXT) AS stvor,
CAST(NULL AS TEXT) AS subty,
CAST(NULL AS TEXT) AS trfar,
CAST(NULL AS TEXT) AS trfgb,
CAST(NULL AS TEXT) AS trfgr,
CAST(NULL AS TEXT) AS trfst,
CAST(NULL AS TEXT) AS uname,
CAST(NULL AS TEXT) AS vglgb,
CAST(NULL AS TEXT) AS vglgr,
CAST(NULL AS TEXT) AS vglst,
CAST(NULL AS TEXT) AS vglsv,
CAST(NULL AS TEXT) AS vglta,
CAST(NULL AS TEXT) AS waers
FROM base
), final AS (
SELECT
mandt,
pernr,
subty,
objps,
sprps,
endda,
begda,
seqnr,
aedtm,
ancur,
ansal,
anz01,
anz02,
anz03,
anz04,
anz05,
anz06,
anz07,
anz08,
anz09,
anz10,
anz11,
anz12,
anz13,
anz14,
anz15,
anz16,
anz17,
anz18,
anz19,
anz20,
anz21,
anz22,
anz23,
anz24,
anz25,
anz26,
anz27,
anz28,
anz29,
anz30,
anz31,
anz32,
anz33,
anz34,
anz35,
anz36,
anz37,
anz38,
anz39,
anz40,
bet01,
bet02,
bet03,
bet04,
bet05,
bet06,
bet07,
bet08,
bet09,
bet10,
bet11,
bet12,
bet13,
bet14,
bet15,
bet16,
bet17,
bet18,
bet19,
bet20,
bet21,
bet22,
bet23,
bet24,
bet25,
bet26,
bet27,
bet28,
bet29,
bet30,
bet31,
bet32,
bet33,
bet34,
bet35,
bet36,
bet37,
bet38,
bet39,
bet40,
bsgrd,
cpind,
divgv,
ein01,
ein02,
ein03,
ein04,
ein05,
ein06,
ein07,
ein08,
ein09,
ein10,
ein11,
ein12,
ein13,
ein14,
ein15,
ein16,
ein17,
ein18,
ein19,
ein20,
ein21,
ein22,
ein23,
ein24,
ein25,
ein26,
ein27,
ein28,
ein29,
ein30,
ein31,
ein32,
ein33,
ein34,
ein35,
ein36,
ein37,
ein38,
ein39,
ein40,
falgk,
falgr,
flag1,
flag2,
flag3,
flag4,
flaga,
grpvl,
histo,
ind01,
ind02,
ind03,
ind04,
ind05,
ind06,
ind07,
ind08,
ind09,
ind10,
ind11,
ind12,
ind13,
ind14,
ind15,
ind16,
ind17,
ind18,
ind19,
ind20,
ind21,
ind22,
ind23,
ind24,
ind25,
ind26,
ind27,
ind28,
ind29,
ind30,
ind31,
ind32,
ind33,
ind34,
ind35,
ind36,
ind37,
ind38,
ind39,
ind40,
itbld,
itxex,
lga01,
lga02,
lga03,
lga04,
lga05,
lga06,
lga07,
lga08,
lga09,
lga10,
lga11,
lga12,
lga13,
lga14,
lga15,
lga16,
lga17,
lga18,
lga19,
lga20,
lga21,
lga22,
lga23,
lga24,
lga25,
lga26,
lga27,
lga28,
lga29,
lga30,
lga31,
lga32,
lga33,
lga34,
lga35,
lga36,
lga37,
lga38,
lga39,
lga40,
opk01,
opk02,
opk03,
opk04,
opk05,
opk06,
opk07,
opk08,
opk09,
opk10,
opk11,
opk12,
opk13,
opk14,
opk15,
opk16,
opk17,
opk18,
opk19,
opk20,
opk21,
opk22,
opk23,
opk24,
opk25,
opk26,
opk27,
opk28,
opk29,
opk30,
opk31,
opk32,
opk33,
opk34,
opk35,
opk36,
opk37,
opk38,
opk39,
opk40,
ordex,
orzst,
partn,
preas,
refex,
rese1,
rese2,
stvor,
trfar,
trfgb,
trfgr,
trfst,
uname,
vglgb,
vglgr,
vglst,
vglsv,
vglta,
waers
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
pernr | None | Personnel number |
subty | None | Subtype |
objps | None | Object identification |
sprps | None | Lock indicator for HR master data record |
begda | None | Start date |
endda | None | End date |
seqnr | None | Number of infotype record with same key |
aedtm | None | Changed on |
ancur | None | Currency key for annual salary |
ansal | None | Annual salary |
anz01 | None | Number/unit |
anz02 | None | Number/unit |
anz03 | None | Number/unit |
anz04 | None | Number/unit |
anz05 | None | Number/unit |
anz06 | None | Number/unit |
anz07 | None | Number/unit |
anz08 | None | Number/unit |
anz09 | None | Number/unit |
anz10 | None | Number/unit |
anz11 | None | Number/unit |
anz12 | None | Number/unit |
anz13 | None | Number/unit |
anz14 | None | Number/unit |
anz15 | None | Number/unit |
anz16 | None | Number/unit |
anz17 | None | Number/unit |
anz18 | None | Number/unit |
anz19 | None | Number/unit |
anz20 | None | Number/unit |
anz21 | None | Number/unit |
anz22 | None | Number/unit |
anz23 | None | Number/unit |
anz24 | None | Number/unit |
anz25 | None | Number/unit |
anz26 | None | Number/unit |
anz27 | None | Number/unit |
anz28 | None | Number/unit |
anz29 | None | Number/unit |
anz30 | None | Number/unit |
anz31 | None | Number/unit |
anz32 | None | Number/unit |
anz33 | None | Number/unit |
anz34 | None | Number/unit |
anz35 | None | Number/unit |
anz36 | None | Number/unit |
anz37 | None | Number/unit |
anz38 | None | Number/unit |
anz39 | None | Number/unit |
anz40 | None | Number/unit |
bet01 | None | Wage type amount for payments |
bet02 | None | Wage type amount for payments |
bet03 | None | Wage type amount for payments |
bet04 | None | Wage type amount for payments |
bet05 | None | Wage type amount for payments |
bet06 | None | Wage type amount for payments |
bet07 | None | Wage type amount for payments |
bet08 | None | Wage type amount for payments |
bet09 | None | Wage type amount for payments |
bet10 | None | Wage type amount for payments |
bet11 | None | Wage type amount for payments |
bet12 | None | Wage type amount for payments |
bet13 | None | Wage type amount for payments |
bet14 | None | Wage type amount for payments |
bet15 | None | Wage type amount for payments |
bet16 | None | Wage type amount for payments |
bet17 | None | Wage type amount for payments |
bet18 | None | Wage type amount for payments |
bet19 | None | Wage type amount for payments |
bet20 | None | Wage type amount for payments |
bet21 | None | Wage type amount for payments |
bet22 | None | Wage type amount for payments |
bet23 | None | Wage type amount for payments |
bet24 | None | Wage type amount for payments |
bet25 | None | Wage type amount for payments |
bet26 | None | Wage type amount for payments |
bet27 | None | Wage type amount for payments |
bet28 | None | Wage type amount for payments |
bet29 | None | Wage type amount for payments |
bet30 | None | Wage type amount for payments |
bet31 | None | Wage type amount for payments |
bet32 | None | Wage type amount for payments |
bet33 | None | Wage type amount for payments |
bet34 | None | Wage type amount for payments |
bet35 | None | Wage type amount for payments |
bet36 | None | Wage type amount for payments |
bet37 | None | Wage type amount for payments |
bet38 | None | Wage type amount for payments |
bet39 | None | Wage type amount for payments |
bet40 | None | Wage type amount for payments |
bsgrd | None | Capacity utilization level |
cpind | None | Planned compensation type |
divgv | None | Working hours per payroll period |
ein01 | None | Time/measurement unit |
ein02 | None | Time/measurement unit |
ein03 | None | Time/measurement unit |
ein04 | None | Time/measurement unit |
ein05 | None | Time/measurement unit |
ein06 | None | Time/measurement unit |
ein07 | None | Time/measurement unit |
ein08 | None | Time/measurement unit |
ein09 | None | Time/measurement unit |
ein10 | None | Time/measurement unit |
ein11 | None | Time/measurement unit |
ein12 | None | Time/measurement unit |
ein13 | None | Time/measurement unit |
ein14 | None | Time/measurement unit |
ein15 | None | Time/measurement unit |
ein16 | None | Time/measurement unit |
ein17 | None | Time/measurement unit |
ein18 | None | Time/measurement unit |
ein19 | None | Time/measurement unit |
ein20 | None | Time/measurement unit |
ein21 | None | Time/measurement unit |
ein22 | None | Time/measurement unit |
ein23 | None | Time/measurement unit |
ein24 | None | Time/measurement unit |
ein25 | None | Time/measurement unit |
ein26 | None | Time/measurement unit |
ein27 | None | Time/measurement unit |
ein28 | None | Time/measurement unit |
ein29 | None | Time/measurement unit |
ein30 | None | Time/measurement unit |
ein31 | None | Time/measurement unit |
ein32 | None | Time/measurement unit |
ein33 | None | Time/measurement unit |
ein34 | None | Time/measurement unit |
ein35 | None | Time/measurement unit |
ein36 | None | Time/measurement unit |
ein37 | None | Time/measurement unit |
ein38 | None | Time/measurement unit |
ein39 | None | Time/measurement unit |
ein40 | None | Time/measurement unit |
falgk | None | Case group catalog |
falgr | None | Case group |
flag1 | None | Reserved field/unused field |
flag2 | None | Reserved field/unused field |
flag3 | None | Reserved field/unused field |
flag4 | None | Reserved field/unused field |
flaga | None | General flag |
grpvl | None | Grouping value for personnel assignments |
histo | None | Historical record flag |
ind01 | None | Indicator for indirect valuation |
ind02 | None | Indicator for indirect valuation |
ind03 | None | Indicator for indirect valuation |
ind04 | None | Indicator for indirect valuation |
ind05 | None | Indicator for indirect valuation |
ind06 | None | Indicator for indirect valuation |
ind07 | None | Indicator for indirect valuation |
ind08 | None | Indicator for indirect valuation |
ind09 | None | Indicator for indirect valuation |
ind10 | None | Indicator for indirect valuation |
ind11 | None | Indicator for indirect valuation |
ind12 | None | Indicator for indirect valuation |
ind13 | None | Indicator for indirect valuation |
ind14 | None | Indicator for indirect valuation |
ind15 | None | Indicator for indirect valuation |
ind16 | None | Indicator for indirect valuation |
ind17 | None | Indicator for indirect valuation |
ind18 | None | Indicator for indirect valuation |
ind19 | None | Indicator for indirect valuation |
ind20 | None | Indicator for indirect valuation |
ind21 | None | Indicator for indirect valuation |
ind22 | None | Indicator for indirect valuation |
ind23 | None | Indicator for indirect valuation |
ind24 | None | Indicator for indirect valuation |
ind25 | None | Indicator for indirect valuation |
ind26 | None | Indicator for indirect valuation |
ind27 | None | Indicator for indirect valuation |
ind28 | None | Indicator for indirect valuation |
ind29 | None | Indicator for indirect valuation |
ind30 | None | Indicator for indirect valuation |
ind31 | None | Indicator for indirect valuation |
ind32 | None | Indicator for indirect valuation |
ind33 | None | Indicator for indirect valuation |
ind34 | None | Indicator for indirect valuation |
ind35 | None | Indicator for indirect valuation |
ind36 | None | Indicator for indirect valuation |
ind37 | None | Indicator for indirect valuation |
ind38 | None | Indicator for indirect valuation |
ind39 | None | Indicator for indirect valuation |
ind40 | None | Indicator for indirect valuation |
itbld | None | Infotype screen control |
itxex | None | Text exists for infotype |
lga01 | None | Wage type |
lga02 | None | Wage type |
lga03 | None | Wage type |
lga04 | None | Wage type |
lga05 | None | Wage type |
lga06 | None | Wage type |
lga07 | None | Wage type |
lga08 | None | Wage type |
lga09 | None | Wage type |
lga10 | None | Wage type |
lga11 | None | Wage type |
lga12 | None | Wage type |
lga13 | None | Wage type |
lga14 | None | Wage type |
lga15 | None | Wage type |
lga16 | None | Wage type |
lga17 | None | Wage type |
lga18 | None | Wage type |
lga19 | None | Wage type |
lga20 | None | Wage type |
lga21 | None | Wage type |
lga22 | None | Wage type |
lga23 | None | Wage type |
lga24 | None | Wage type |
lga25 | None | Wage type |
lga26 | None | Wage type |
lga27 | None | Wage type |
lga28 | None | Wage type |
lga29 | None | Wage type |
lga30 | None | Wage type |
lga31 | None | Wage type |
lga32 | None | Wage type |
lga33 | None | Wage type |
lga34 | None | Wage type |
lga35 | None | Wage type |
lga36 | None | Wage type |
lga37 | None | Wage type |
lga38 | None | Wage type |
lga39 | None | Wage type |
lga40 | None | Wage type |
opk01 | None | Operation indicator for wage types |
opk02 | None | Operation indicator for wage types |
opk03 | None | Operation indicator for wage types |
opk04 | None | Operation indicator for wage types |
opk05 | None | Operation indicator for wage types |
opk06 | None | Operation indicator for wage types |
opk07 | None | Operation indicator for wage types |
opk08 | None | Operation indicator for wage types |
opk09 | None | Operation indicator for wage types |
opk10 | None | Operation indicator for wage types |
opk11 | None | Operation indicator for wage types |
opk12 | None | Operation indicator for wage types |
opk13 | None | Operation indicator for wage types |
opk14 | None | Operation indicator for wage types |
opk15 | None | Operation indicator for wage types |
opk16 | None | Operation indicator for wage types |
opk17 | None | Operation indicator for wage types |
opk18 | None | Operation indicator for wage types |
opk19 | None | Operation indicator for wage types |
opk20 | None | Operation indicator for wage types |
opk21 | None | Operation indicator for wage types |
opk22 | None | Operation indicator for wage types |
opk23 | None | Operation indicator for wage types |
opk24 | None | Operation indicator for wage types |
opk25 | None | Operation indicator for wage types |
opk26 | None | Operation indicator for wage types |
opk27 | None | Operation indicator for wage types |
opk28 | None | Operation indicator for wage types |
opk29 | None | Operation indicator for wage types |
opk30 | None | Operation indicator for wage types |
opk31 | None | Operation indicator for wage types |
opk32 | None | Operation indicator for wage types |
opk33 | None | Operation indicator for wage types |
opk34 | None | Operation indicator for wage types |
opk35 | None | Operation indicator for wage types |
opk36 | None | Operation indicator for wage types |
opk37 | None | Operation indicator for wage types |
opk38 | None | Operation indicator for wage types |
opk39 | None | Operation indicator for wage types |
opk40 | None | Operation indicator for wage types |
ordex | None | Confirmation fields exist |
orzst | None | Cost of living allowance level |
partn | None | Partnership |
preas | None | Reason for changing master data |
refex | None | Reference fields exist (primary/secondary costs) |
rese1 | None | Reserved field/unused field of length 2 |
rese2 | None | Reserved field/unused field of length 2 |
stvor | None | Date of next increase |
trfar | None | Pay scale type |
trfgb | None | Pay scale area |
trfgr | None | Pay scale group |
trfst | None | Pay scale level |
uname | None | Name of person who changed object |
vglgb | None | Comparison pay scale area |
vglgr | None | Comparison pay scale group |
vglst | None | Comparison pay scale level |
vglsv | None | Date of next increase |
vglta | None | Comparison pay scale type |
waers | None | Currency key |
MANDT | TEXT | None |
PERNR | TEXT | None |
SUBTY | TEXT | None |
OBJPS | TEXT | None |
SPRPS | TEXT | None |
ENDDA | TEXT | None |
BEGDA | TEXT | None |
SEQNR | TEXT | None |
AEDTM | TEXT | None |
ANCUR | TEXT | None |
ANSAL | NUMBER | None |
ANZ01 | NUMBER | None |
ANZ02 | NUMBER | None |
ANZ03 | NUMBER | None |
ANZ04 | NUMBER | None |
ANZ05 | NUMBER | None |
ANZ06 | NUMBER | None |
ANZ07 | NUMBER | None |
ANZ08 | NUMBER | None |
ANZ09 | NUMBER | None |
ANZ10 | NUMBER | None |
ANZ11 | NUMBER | None |
ANZ12 | NUMBER | None |
ANZ13 | NUMBER | None |
ANZ14 | NUMBER | None |
ANZ15 | NUMBER | None |
ANZ16 | NUMBER | None |
ANZ17 | NUMBER | None |
ANZ18 | NUMBER | None |
ANZ19 | NUMBER | None |
ANZ20 | NUMBER | None |
ANZ21 | NUMBER | None |
ANZ22 | NUMBER | None |
ANZ23 | NUMBER | None |
ANZ24 | NUMBER | None |
ANZ25 | NUMBER | None |
ANZ26 | NUMBER | None |
ANZ27 | NUMBER | None |
ANZ28 | NUMBER | None |
ANZ29 | NUMBER | None |
ANZ30 | NUMBER | None |
ANZ31 | NUMBER | None |
ANZ32 | NUMBER | None |
ANZ33 | NUMBER | None |
ANZ34 | NUMBER | None |
ANZ35 | NUMBER | None |
ANZ36 | NUMBER | None |
ANZ37 | NUMBER | None |
ANZ38 | NUMBER | None |
ANZ39 | NUMBER | None |
ANZ40 | NUMBER | None |
BET01 | NUMBER | None |
BET02 | NUMBER | None |
BET03 | NUMBER | None |
BET04 | NUMBER | None |
BET05 | NUMBER | None |
BET06 | NUMBER | None |
BET07 | NUMBER | None |
BET08 | NUMBER | None |
BET09 | NUMBER | None |
BET10 | NUMBER | None |
BET11 | NUMBER | None |
BET12 | NUMBER | None |
BET13 | NUMBER | None |
BET14 | NUMBER | None |
BET15 | NUMBER | None |
BET16 | NUMBER | None |
BET17 | NUMBER | None |
BET18 | NUMBER | None |
BET19 | NUMBER | None |
BET20 | NUMBER | None |
BET21 | NUMBER | None |
BET22 | NUMBER | None |
BET23 | NUMBER | None |
BET24 | NUMBER | None |
BET25 | NUMBER | None |
BET26 | NUMBER | None |
BET27 | NUMBER | None |
BET28 | NUMBER | None |
BET29 | NUMBER | None |
BET30 | NUMBER | None |
BET31 | NUMBER | None |
BET32 | NUMBER | None |
BET33 | NUMBER | None |
BET34 | NUMBER | None |
BET35 | NUMBER | None |
BET36 | NUMBER | None |
BET37 | NUMBER | None |
BET38 | NUMBER | None |
BET39 | NUMBER | None |
BET40 | NUMBER | None |
BSGRD | NUMBER | None |
CPIND | TEXT | None |
DIVGV | NUMBER | None |
EIN01 | TEXT | None |
EIN02 | TEXT | None |
EIN03 | TEXT | None |
EIN04 | TEXT | None |
EIN05 | TEXT | None |
EIN06 | TEXT | None |
EIN07 | TEXT | None |
EIN08 | TEXT | None |
EIN09 | TEXT | None |
EIN10 | TEXT | None |
EIN11 | TEXT | None |
EIN12 | TEXT | None |
EIN13 | TEXT | None |
EIN14 | TEXT | None |
EIN15 | TEXT | None |
EIN16 | TEXT | None |
EIN17 | TEXT | None |
EIN18 | TEXT | None |
EIN19 | TEXT | None |
EIN20 | TEXT | None |
EIN21 | TEXT | None |
EIN22 | TEXT | None |
EIN23 | TEXT | None |
EIN24 | TEXT | None |
EIN25 | TEXT | None |
EIN26 | TEXT | None |
EIN27 | TEXT | None |
EIN28 | TEXT | None |
EIN29 | TEXT | None |
EIN30 | TEXT | None |
EIN31 | TEXT | None |
EIN32 | TEXT | None |
EIN33 | TEXT | None |
EIN34 | TEXT | None |
EIN35 | TEXT | None |
EIN36 | TEXT | None |
EIN37 | TEXT | None |
EIN38 | TEXT | None |
EIN39 | TEXT | None |
EIN40 | TEXT | None |
FALGK | TEXT | None |
FALGR | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
FLAGA | TEXT | None |
GRPVL | TEXT | None |
HISTO | TEXT | None |
IND01 | TEXT | None |
IND02 | TEXT | None |
IND03 | TEXT | None |
IND04 | TEXT | None |
IND05 | TEXT | None |
IND06 | TEXT | None |
IND07 | TEXT | None |
IND08 | TEXT | None |
IND09 | TEXT | None |
IND10 | TEXT | None |
IND11 | TEXT | None |
IND12 | TEXT | None |
IND13 | TEXT | None |
IND14 | TEXT | None |
IND15 | TEXT | None |
IND16 | TEXT | None |
IND17 | TEXT | None |
IND18 | TEXT | None |
IND19 | TEXT | None |
IND20 | TEXT | None |
IND21 | TEXT | None |
IND22 | TEXT | None |
IND23 | TEXT | None |
IND24 | TEXT | None |
IND25 | TEXT | None |
IND26 | TEXT | None |
IND27 | TEXT | None |
IND28 | TEXT | None |
IND29 | TEXT | None |
IND30 | TEXT | None |
IND31 | TEXT | None |
IND32 | TEXT | None |
IND33 | TEXT | None |
IND34 | TEXT | None |
IND35 | TEXT | None |
IND36 | TEXT | None |
IND37 | TEXT | None |
IND38 | TEXT | None |
IND39 | TEXT | None |
IND40 | TEXT | None |
ITBLD | TEXT | None |
ITXEX | TEXT | None |
LGA01 | TEXT | None |
LGA02 | TEXT | None |
LGA03 | TEXT | None |
LGA04 | TEXT | None |
LGA05 | TEXT | None |
LGA06 | TEXT | None |
LGA07 | TEXT | None |
LGA08 | TEXT | None |
LGA09 | TEXT | None |
LGA10 | TEXT | None |
LGA11 | TEXT | None |
LGA12 | TEXT | None |
LGA13 | TEXT | None |
LGA14 | TEXT | None |
LGA15 | TEXT | None |
LGA16 | TEXT | None |
LGA17 | TEXT | None |
LGA18 | TEXT | None |
LGA19 | TEXT | None |
LGA20 | TEXT | None |
LGA21 | TEXT | None |
LGA22 | TEXT | None |
LGA23 | TEXT | None |
LGA24 | TEXT | None |
LGA25 | TEXT | None |
LGA26 | TEXT | None |
LGA27 | TEXT | None |
LGA28 | TEXT | None |
LGA29 | TEXT | None |
LGA30 | TEXT | None |
LGA31 | TEXT | None |
LGA32 | TEXT | None |
LGA33 | TEXT | None |
LGA34 | TEXT | None |
LGA35 | TEXT | None |
LGA36 | TEXT | None |
LGA37 | TEXT | None |
LGA38 | TEXT | None |
LGA39 | TEXT | None |
LGA40 | TEXT | None |
OPK01 | TEXT | None |
OPK02 | TEXT | None |
OPK03 | TEXT | None |
OPK04 | TEXT | None |
OPK05 | TEXT | None |
OPK06 | TEXT | None |
OPK07 | TEXT | None |
OPK08 | TEXT | None |
OPK09 | TEXT | None |
OPK10 | TEXT | None |
OPK11 | TEXT | None |
OPK12 | TEXT | None |
OPK13 | TEXT | None |
OPK14 | TEXT | None |
OPK15 | TEXT | None |
OPK16 | TEXT | None |
OPK17 | TEXT | None |
OPK18 | TEXT | None |
OPK19 | TEXT | None |
OPK20 | TEXT | None |
OPK21 | TEXT | None |
OPK22 | TEXT | None |
OPK23 | TEXT | None |
OPK24 | TEXT | None |
OPK25 | TEXT | None |
OPK26 | TEXT | None |
OPK27 | TEXT | None |
OPK28 | TEXT | None |
OPK29 | TEXT | None |
OPK30 | TEXT | None |
OPK31 | TEXT | None |
OPK32 | TEXT | None |
OPK33 | TEXT | None |
OPK34 | TEXT | None |
OPK35 | TEXT | None |
OPK36 | TEXT | None |
OPK37 | TEXT | None |
OPK38 | TEXT | None |
OPK39 | TEXT | None |
OPK40 | TEXT | None |
ORDEX | TEXT | None |
ORZST | TEXT | None |
PARTN | TEXT | None |
PREAS | TEXT | None |
REFEX | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
STVOR | TEXT | None |
TRFAR | TEXT | None |
TRFGB | TEXT | None |
TRFGR | TEXT | None |
TRFST | TEXT | None |
UNAME | TEXT | None |
VGLGB | TEXT | None |
VGLGR | TEXT | None |
VGLST | TEXT | None |
VGLSV | TEXT | None |
VGLTA | TEXT | None |
WAERS | TEXT | None |
This SQL query selects all columns and rows from the table 'pa0008' in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformations, or other operations.
OtherSELECT
*
FROM TEST.sap.pa0008
Name | Type | Comment |
---|---|---|
BEGDA | TEXT | None |
ENDDA | TEXT | None |
MANDT | TEXT | None |
OBJPS | TEXT | None |
PERNR | TEXT | None |
SEQNR | TEXT | None |
SPRPS | TEXT | None |
SUBTY | TEXT | None |
AEDTM | TEXT | None |
UNAME | TEXT | None |
HISTO | TEXT | None |
ITXEX | TEXT | None |
REFEX | TEXT | None |
ORDEX | TEXT | None |
ITBLD | TEXT | None |
PREAS | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
GRPVL | TEXT | None |
TRFAR | TEXT | None |
TRFGB | TEXT | None |
TRFGR | TEXT | None |
TRFST | TEXT | None |
STVOR | TEXT | None |
ORZST | TEXT | None |
PARTN | TEXT | None |
WAERS | TEXT | None |
VGLTA | TEXT | None |
VGLGB | TEXT | None |
VGLGR | TEXT | None |
VGLST | TEXT | None |
VGLSV | TEXT | None |
BSGRD | NUMBER | None |
DIVGV | NUMBER | None |
ANSAL | NUMBER | None |
FALGK | TEXT | None |
FALGR | TEXT | None |
LGA01 | TEXT | None |
BET01 | NUMBER | None |
ANZ01 | NUMBER | None |
EIN01 | TEXT | None |
OPK01 | TEXT | None |
LGA02 | TEXT | None |
BET02 | NUMBER | None |
ANZ02 | NUMBER | None |
EIN02 | TEXT | None |
OPK02 | TEXT | None |
LGA03 | TEXT | None |
BET03 | NUMBER | None |
ANZ03 | NUMBER | None |
EIN03 | TEXT | None |
OPK03 | TEXT | None |
LGA04 | TEXT | None |
BET04 | NUMBER | None |
ANZ04 | NUMBER | None |
EIN04 | TEXT | None |
OPK04 | TEXT | None |
LGA05 | TEXT | None |
BET05 | NUMBER | None |
ANZ05 | NUMBER | None |
EIN05 | TEXT | None |
OPK05 | TEXT | None |
LGA06 | TEXT | None |
BET06 | NUMBER | None |
ANZ06 | NUMBER | None |
EIN06 | TEXT | None |
OPK06 | TEXT | None |
LGA07 | TEXT | None |
BET07 | NUMBER | None |
ANZ07 | NUMBER | None |
EIN07 | TEXT | None |
OPK07 | TEXT | None |
LGA08 | TEXT | None |
BET08 | NUMBER | None |
ANZ08 | NUMBER | None |
EIN08 | TEXT | None |
OPK08 | TEXT | None |
LGA09 | TEXT | None |
BET09 | NUMBER | None |
ANZ09 | NUMBER | None |
EIN09 | TEXT | None |
OPK09 | TEXT | None |
LGA10 | TEXT | None |
BET10 | NUMBER | None |
ANZ10 | NUMBER | None |
EIN10 | TEXT | None |
OPK10 | TEXT | None |
LGA11 | TEXT | None |
BET11 | NUMBER | None |
ANZ11 | NUMBER | None |
EIN11 | TEXT | None |
OPK11 | TEXT | None |
LGA12 | TEXT | None |
BET12 | NUMBER | None |
ANZ12 | NUMBER | None |
EIN12 | TEXT | None |
OPK12 | TEXT | None |
LGA13 | TEXT | None |
BET13 | NUMBER | None |
ANZ13 | NUMBER | None |
EIN13 | TEXT | None |
OPK13 | TEXT | None |
LGA14 | TEXT | None |
BET14 | NUMBER | None |
ANZ14 | NUMBER | None |
EIN14 | TEXT | None |
OPK14 | TEXT | None |
LGA15 | TEXT | None |
BET15 | NUMBER | None |
ANZ15 | NUMBER | None |
EIN15 | TEXT | None |
OPK15 | TEXT | None |
LGA16 | TEXT | None |
BET16 | NUMBER | None |
ANZ16 | NUMBER | None |
EIN16 | TEXT | None |
OPK16 | TEXT | None |
LGA17 | TEXT | None |
BET17 | NUMBER | None |
ANZ17 | NUMBER | None |
EIN17 | TEXT | None |
OPK17 | TEXT | None |
LGA18 | TEXT | None |
BET18 | NUMBER | None |
ANZ18 | NUMBER | None |
EIN18 | TEXT | None |
OPK18 | TEXT | None |
LGA19 | TEXT | None |
BET19 | NUMBER | None |
ANZ19 | NUMBER | None |
EIN19 | TEXT | None |
OPK19 | TEXT | None |
LGA20 | TEXT | None |
BET20 | NUMBER | None |
ANZ20 | NUMBER | None |
EIN20 | TEXT | None |
OPK20 | TEXT | None |
LGA21 | TEXT | None |
BET21 | NUMBER | None |
ANZ21 | NUMBER | None |
EIN21 | TEXT | None |
OPK21 | TEXT | None |
LGA22 | TEXT | None |
BET22 | NUMBER | None |
ANZ22 | NUMBER | None |
EIN22 | TEXT | None |
OPK22 | TEXT | None |
LGA23 | TEXT | None |
BET23 | NUMBER | None |
ANZ23 | NUMBER | None |
EIN23 | TEXT | None |
OPK23 | TEXT | None |
LGA24 | TEXT | None |
BET24 | NUMBER | None |
ANZ24 | NUMBER | None |
EIN24 | TEXT | None |
OPK24 | TEXT | None |
LGA25 | TEXT | None |
BET25 | NUMBER | None |
ANZ25 | NUMBER | None |
EIN25 | TEXT | None |
OPK25 | TEXT | None |
LGA26 | TEXT | None |
BET26 | NUMBER | None |
ANZ26 | NUMBER | None |
EIN26 | TEXT | None |
OPK26 | TEXT | None |
LGA27 | TEXT | None |
BET27 | NUMBER | None |
ANZ27 | NUMBER | None |
EIN27 | TEXT | None |
OPK27 | TEXT | None |
LGA28 | TEXT | None |
BET28 | NUMBER | None |
ANZ28 | NUMBER | None |
EIN28 | TEXT | None |
OPK28 | TEXT | None |
LGA29 | TEXT | None |
BET29 | NUMBER | None |
ANZ29 | NUMBER | None |
EIN29 | TEXT | None |
OPK29 | TEXT | None |
LGA30 | TEXT | None |
BET30 | NUMBER | None |
ANZ30 | NUMBER | None |
EIN30 | TEXT | None |
OPK30 | TEXT | None |
LGA31 | TEXT | None |
BET31 | NUMBER | None |
ANZ31 | NUMBER | None |
EIN31 | TEXT | None |
OPK31 | TEXT | None |
LGA32 | TEXT | None |
BET32 | NUMBER | None |
ANZ32 | NUMBER | None |
EIN32 | TEXT | None |
OPK32 | TEXT | None |
LGA33 | TEXT | None |
BET33 | NUMBER | None |
ANZ33 | NUMBER | None |
EIN33 | TEXT | None |
OPK33 | TEXT | None |
LGA34 | TEXT | None |
BET34 | NUMBER | None |
ANZ34 | NUMBER | None |
EIN34 | TEXT | None |
OPK34 | TEXT | None |
LGA35 | TEXT | None |
BET35 | NUMBER | None |
ANZ35 | NUMBER | None |
EIN35 | TEXT | None |
OPK35 | TEXT | None |
LGA36 | TEXT | None |
BET36 | NUMBER | None |
ANZ36 | NUMBER | None |
EIN36 | TEXT | None |
OPK36 | TEXT | None |
LGA37 | TEXT | None |
BET37 | NUMBER | None |
ANZ37 | NUMBER | None |
EIN37 | TEXT | None |
OPK37 | TEXT | None |
LGA38 | TEXT | None |
BET38 | NUMBER | None |
ANZ38 | NUMBER | None |
EIN38 | TEXT | None |
OPK38 | TEXT | None |
LGA39 | TEXT | None |
BET39 | NUMBER | None |
ANZ39 | NUMBER | None |
EIN39 | TEXT | None |
OPK39 | TEXT | None |
LGA40 | TEXT | None |
BET40 | NUMBER | None |
ANZ40 | NUMBER | None |
EIN40 | TEXT | None |
OPK40 | TEXT | None |
IND01 | TEXT | None |
IND02 | TEXT | None |
IND03 | TEXT | None |
IND04 | TEXT | None |
IND05 | TEXT | None |
IND06 | TEXT | None |
IND07 | TEXT | None |
IND08 | TEXT | None |
IND09 | TEXT | None |
IND10 | TEXT | None |
IND11 | TEXT | None |
IND12 | TEXT | None |
IND13 | TEXT | None |
IND14 | TEXT | None |
IND15 | TEXT | None |
IND16 | TEXT | None |
IND17 | TEXT | None |
IND18 | TEXT | None |
IND19 | TEXT | None |
IND20 | TEXT | None |
IND21 | TEXT | None |
IND22 | TEXT | None |
IND23 | TEXT | None |
IND24 | TEXT | None |
IND25 | TEXT | None |
IND26 | TEXT | None |
IND27 | TEXT | None |
IND28 | TEXT | None |
IND29 | TEXT | None |
IND30 | TEXT | None |
IND31 | TEXT | None |
IND32 | TEXT | None |
IND33 | TEXT | None |
IND34 | TEXT | None |
IND35 | TEXT | None |
IND36 | TEXT | None |
IND37 | TEXT | None |
IND38 | TEXT | None |
IND39 | TEXT | None |
IND40 | TEXT | None |
ANCUR | TEXT | None |
CPIND | TEXT | None |
FLAGA | TEXT | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a basic data transformation and type casting operation on the 'stg_sap__pa0031_tmp' table. It creates a CTE named 'fields' where it explicitly casts all columns to specific data types, mostly as TEXT, with a few exceptions for _fivetran_deleted (BOOLEAN), _fivetran_rowid (DECIMAL), and _fivetran_synced (TIMESTAMP). The query then selects a subset of these fields in a specific order in the 'final' CTE, excluding the _fivetran_ columns. The main purpose seems to be to standardize the data types and structure of the output.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__pa0031_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS aedtm,
CAST(NULL AS TEXT) AS begda,
CAST(NULL AS TEXT) AS endda,
CAST(NULL AS TEXT) AS flag1,
CAST(NULL AS TEXT) AS flag2,
CAST(NULL AS TEXT) AS flag3,
CAST(NULL AS TEXT) AS flag4,
CAST(NULL AS TEXT) AS grpvl,
CAST(NULL AS TEXT) AS histo,
CAST(NULL AS TEXT) AS itbld,
CAST(NULL AS TEXT) AS itxex,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS objps,
CAST(NULL AS TEXT) AS ordex,
CAST(NULL AS TEXT) AS pernr,
CAST(NULL AS TEXT) AS preas,
CAST(NULL AS TEXT) AS refex,
CAST(NULL AS TEXT) AS rese1,
CAST(NULL AS TEXT) AS rese2,
CAST(NULL AS TEXT) AS rfp01,
CAST(NULL AS TEXT) AS rfp02,
CAST(NULL AS TEXT) AS rfp03,
CAST(NULL AS TEXT) AS rfp04,
CAST(NULL AS TEXT) AS rfp05,
CAST(NULL AS TEXT) AS rfp06,
CAST(NULL AS TEXT) AS rfp07,
CAST(NULL AS TEXT) AS rfp08,
CAST(NULL AS TEXT) AS rfp09,
CAST(NULL AS TEXT) AS rfp10,
CAST(NULL AS TEXT) AS rfp11,
CAST(NULL AS TEXT) AS rfp12,
CAST(NULL AS TEXT) AS rfp13,
CAST(NULL AS TEXT) AS rfp14,
CAST(NULL AS TEXT) AS rfp15,
CAST(NULL AS TEXT) AS rfp16,
CAST(NULL AS TEXT) AS rfp17,
CAST(NULL AS TEXT) AS rfp18,
CAST(NULL AS TEXT) AS rfp19,
CAST(NULL AS TEXT) AS rfp20,
CAST(NULL AS TEXT) AS seqnr,
CAST(NULL AS TEXT) AS sprps,
CAST(NULL AS TEXT) AS subty,
CAST(NULL AS TEXT) AS uname
FROM base
), final AS (
SELECT
mandt,
pernr,
subty,
objps,
sprps,
endda,
begda,
seqnr,
aedtm,
flag1,
flag2,
flag3,
flag4,
grpvl,
histo,
itbld,
itxex,
ordex,
preas,
refex,
rese1,
rese2,
rfp01,
rfp02,
rfp03,
rfp04,
rfp05,
rfp06,
rfp07,
rfp08,
rfp09,
rfp10,
rfp11,
rfp12,
rfp13,
rfp14,
rfp15,
rfp16,
rfp17,
rfp18,
rfp19,
rfp20,
uname
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
pernr | None | Personnel number |
subty | None | Subtype |
objps | None | Object information |
sprps | None | Lock indicator for HR master data record |
begda | None | Start date |
endda | None | End date |
seqnr | None | Number of infotype record with same key |
aedtm | None | Changed on |
flag1 | None | Reserved field/unused field |
flag2 | None | Reserved field/unused field |
flag3 | None | Reserved field/unused field |
flag4 | None | Reserved field/unused field |
grpvl | None | Grouping value for personnel assignments |
histo | None | Historical record flag |
itbld | None | Infotype screen control |
itxex | None | Text exists for infotype |
ordex | None | Confirmation fields exist |
preas | None | Reason for changing master data |
refex | None | Reference fields exist |
rese1 | None | Reserved field/unused field of length 2 |
rese2 | None | Reserved field/unused field of length 2 |
rfp01 | None | Reference personnel number |
rfp02 | None | Reference personnel number |
rfp03 | None | Reference personnel number |
rfp04 | None | Reference personnel number |
rfp05 | None | Reference personnel number |
rfp06 | None | Reference personnel number |
rfp07 | None | Reference personnel number |
rfp08 | None | Reference personnel number |
rfp09 | None | Reference personnel number |
rfp10 | None | Reference personnel number |
rfp11 | None | Reference personnel number |
rfp12 | None | Reference personnel number |
rfp13 | None | Reference personnel number |
rfp14 | None | Reference personnel number |
rfp15 | None | Reference personnel number |
rfp16 | None | Reference personnel number |
rfp17 | None | Reference personnel number |
rfp18 | None | Reference personnel number |
rfp19 | None | Reference personnel number |
rfp20 | None | Reference personnel number |
uname | None | Name of person who changed object |
MANDT | TEXT | None |
PERNR | TEXT | None |
SUBTY | TEXT | None |
OBJPS | TEXT | None |
SPRPS | TEXT | None |
ENDDA | TEXT | None |
BEGDA | TEXT | None |
SEQNR | TEXT | None |
AEDTM | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
GRPVL | TEXT | None |
HISTO | TEXT | None |
ITBLD | TEXT | None |
ITXEX | TEXT | None |
ORDEX | TEXT | None |
PREAS | TEXT | None |
REFEX | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
RFP01 | TEXT | None |
RFP02 | TEXT | None |
RFP03 | TEXT | None |
RFP04 | TEXT | None |
RFP05 | TEXT | None |
RFP06 | TEXT | None |
RFP07 | TEXT | None |
RFP08 | TEXT | None |
RFP09 | TEXT | None |
RFP10 | TEXT | None |
RFP11 | TEXT | None |
RFP12 | TEXT | None |
RFP13 | TEXT | None |
RFP14 | TEXT | None |
RFP15 | TEXT | None |
RFP16 | TEXT | None |
RFP17 | TEXT | None |
RFP18 | TEXT | None |
RFP19 | TEXT | None |
RFP20 | TEXT | None |
UNAME | TEXT | None |
This SQL query selects all columns and rows from the table 'pa0031' in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.pa0031
Name | Type | Comment |
---|---|---|
AEDTM | TEXT | None |
BEGDA | TEXT | None |
ENDDA | TEXT | None |
FLAG1 | TEXT | None |
FLAG2 | TEXT | None |
FLAG3 | TEXT | None |
FLAG4 | TEXT | None |
GRPVL | TEXT | None |
HISTO | TEXT | None |
ITBLD | TEXT | None |
ITXEX | TEXT | None |
MANDT | TEXT | None |
OBJPS | TEXT | None |
ORDEX | TEXT | None |
PERNR | TEXT | None |
PREAS | TEXT | None |
REFEX | TEXT | None |
RESE1 | TEXT | None |
RESE2 | TEXT | None |
RFP01 | TEXT | None |
RFP02 | TEXT | None |
RFP03 | TEXT | None |
RFP04 | TEXT | None |
RFP05 | TEXT | None |
RFP06 | TEXT | None |
RFP07 | TEXT | None |
RFP08 | TEXT | None |
RFP09 | TEXT | None |
RFP10 | TEXT | None |
RFP11 | TEXT | None |
RFP12 | TEXT | None |
RFP13 | TEXT | None |
RFP14 | TEXT | None |
RFP15 | TEXT | None |
RFP16 | TEXT | None |
RFP17 | TEXT | None |
RFP18 | TEXT | None |
RFP19 | TEXT | None |
RFP20 | TEXT | None |
SEQNR | TEXT | None |
SPRPS | TEXT | None |
SUBTY | TEXT | None |
UNAME | TEXT | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a basic data transformation for the 'stg_sap__ska1' model. It selects all columns from a temporary table, casts them to specific data types (mostly to TEXT, with a few exceptions), and then reorganizes the columns in a specific order in the final SELECT statement. The query doesn't perform any filtering, cleaning, deduplication, featurization, integration, or aggregation.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__ska1_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS bilkt,
CAST(NULL AS TEXT) AS erdat,
CAST(NULL AS TEXT) AS ernam,
CAST(NULL AS TEXT) AS func_area,
CAST(NULL AS TEXT) AS gvtyp,
CAST(NULL AS TEXT) AS ktoks,
CAST(NULL AS TEXT) AS ktopl,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mcod1,
CAST(NULL AS TEXT) AS mustr,
CAST(NULL AS TEXT) AS sakan,
CAST(NULL AS TEXT) AS saknr,
CAST(NULL AS TEXT) AS vbund,
CAST(NULL AS TEXT) AS xbilk,
CAST(NULL AS TEXT) AS xloev,
CAST(NULL AS TEXT) AS xspea,
CAST(NULL AS TEXT) AS xspeb,
CAST(NULL AS TEXT) AS xspep
FROM base
), final AS (
SELECT
mandt,
ktopl,
saknr,
bilkt,
gvtyp,
vbund,
xbilk,
sakan,
erdat,
ernam,
ktoks,
xloev,
xspea,
xspeb,
xspep,
func_area,
mustr,
_fivetran_rowid,
_fivetran_deleted,
_fivetran_synced
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
ktopl | None | Chart of accounts |
saknr | None | G/L account number |
bilkt | None | Group account number |
gvtyp | None | P&L statement account type |
vbund | None | Company id of tradiing partner |
xbilk | None | Indicator (account is a balance sheet account?) |
sakan | None | G/L account number, significant length |
erdat | None | Date on which the record was created |
ernam | None | Name of person who created the object |
ktoks | None | G/L account group |
xloev | None | Indicator (account marked for deletion?) |
xspea | None | Indicator (account is blocked for creation?) |
xspeb | None | Indicator (Is account blocked for posting?) |
xspep | None | Indicator (Account blocked for planning?) |
func_area | None | Functional area |
mustr | None | Number of the sample account |
MANDT | NUMBER | None |
KTOPL | TEXT | None |
SAKNR | NUMBER | None |
BILKT | NUMBER | None |
GVTYP | NUMBER | None |
VBUND | NUMBER | None |
XBILK | TEXT | None |
SAKAN | NUMBER | None |
ERDAT | NUMBER | None |
ERNAM | TEXT | None |
KTOKS | TEXT | None |
XLOEV | NUMBER | None |
XSPEA | NUMBER | None |
XSPEB | NUMBER | None |
XSPEP | NUMBER | None |
FUNC_AREA | NUMBER | None |
MUSTR | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query selects all columns and rows from the 'ska1' table in the 'sap' schema of the 'TEST' database. It's a simple SELECT * statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.ska1
Name | Type | Comment |
---|---|---|
MANDT | NUMBER | None |
KTOPL | TEXT | None |
SAKNR | NUMBER | None |
BILKT | NUMBER | None |
GVTYP | NUMBER | None |
VBUND | NUMBER | None |
XBILK | TEXT | None |
SAKAN | NUMBER | None |
ERDAT | NUMBER | None |
ERNAM | TEXT | None |
KTOKS | TEXT | None |
XLOEV | NUMBER | None |
XSPEA | NUMBER | None |
XSPEB | NUMBER | None |
XSPEP | NUMBER | None |
FUNC_AREA | NUMBER | None |
MUSTR | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs data type casting and column selection on the 'stg_sap__t001_tmp' table. It starts by selecting all columns from the base table, then casts a large number of columns to specific data types (mostly TEXT) in the 'fields' CTE. Finally, it selects and casts a subset of columns from the 'fields' CTE to create the final output.
CleaningOtherWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__t001_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS adrnr,
CAST(NULL AS TEXT) AS bapovar,
CAST(NULL AS TEXT) AS bukrs,
CAST(NULL AS TEXT) AS bukrs_glob,
CAST(NULL AS TEXT) AS butxt,
CAST(NULL AS TEXT) AS buvar,
CAST(NULL AS TEXT) AS dkweg,
CAST(NULL AS TEXT) AS dtamtc,
CAST(NULL AS TEXT) AS dtaxr,
CAST(NULL AS TEXT) AS dtprov,
CAST(NULL AS TEXT) AS dttaxc,
CAST(NULL AS TEXT) AS dttdsp,
CAST(NULL AS TEXT) AS ebukr,
CAST(NULL AS TEXT) AS fdbuk,
CAST(NULL AS TEXT) AS fikrs,
CAST(NULL AS TEXT) AS fm_derive_acc,
CAST(NULL AS TEXT) AS fmhrdate,
CAST(NULL AS TEXT) AS fstva,
CAST(NULL AS TEXT) AS fstvare,
CAST(NULL AS TEXT) AS impda,
CAST(NULL AS TEXT) AS infmt,
CAST(NULL AS TEXT) AS kkber,
CAST(NULL AS TEXT) AS kokfi,
CAST(NULL AS TEXT) AS kopim,
CAST(NULL AS TEXT) AS ktop2,
CAST(NULL AS TEXT) AS ktopl,
CAST(NULL AS TEXT) AS land1,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mregl,
CAST(NULL AS TEXT) AS mwska,
CAST(NULL AS TEXT) AS mwskv,
CAST(NULL AS TEXT) AS offsacct,
CAST(NULL AS TEXT) AS opvar,
CAST(NULL AS TEXT) AS ort01,
CAST(NULL AS TEXT) AS periv,
CAST(NULL AS TEXT) AS pp_pdate,
CAST(NULL AS TEXT) AS pst_per_var,
CAST(NULL AS TEXT) AS rcomp,
CAST(NULL AS TEXT) AS spras,
CAST(NULL AS TEXT) AS stceg,
CAST(NULL AS TEXT) AS surccm,
CAST(NULL AS TEXT) AS txjcd,
CAST(NULL AS TEXT) AS txkrs,
CAST(NULL AS TEXT) AS umkrs,
CAST(NULL AS TEXT) AS waabw,
CAST(NULL AS TEXT) AS waers,
CAST(NULL AS TEXT) AS wfvar,
CAST(NULL AS TEXT) AS wt_newwt,
CAST(NULL AS TEXT) AS xbbba,
CAST(NULL AS TEXT) AS xbbbe,
CAST(NULL AS TEXT) AS xbbbf,
CAST(NULL AS TEXT) AS xbbko,
CAST(NULL AS TEXT) AS xbbsc,
CAST(NULL AS TEXT) AS xcession,
CAST(NULL AS TEXT) AS xcos,
CAST(NULL AS TEXT) AS xcovr,
CAST(NULL AS TEXT) AS xeink,
CAST(NULL AS TEXT) AS xextb,
CAST(NULL AS TEXT) AS xfdis,
CAST(NULL AS TEXT) AS xfdmm,
CAST(NULL AS TEXT) AS xfdsd,
CAST(NULL AS TEXT) AS xfmca,
CAST(NULL AS TEXT) AS xfmcb,
CAST(NULL AS TEXT) AS xfmco,
CAST(NULL AS TEXT) AS xgjrv,
CAST(NULL AS TEXT) AS xgsbe,
CAST(NULL AS TEXT) AS xjvaa,
CAST(NULL AS TEXT) AS xkdft,
CAST(NULL AS TEXT) AS xkkbi,
CAST(NULL AS TEXT) AS xmwsn,
CAST(NULL AS TEXT) AS xnegp,
CAST(NULL AS TEXT) AS xprod,
CAST(NULL AS TEXT) AS xskfn,
CAST(NULL AS TEXT) AS xslta,
CAST(NULL AS TEXT) AS xsplt,
CAST(NULL AS TEXT) AS xstdt,
CAST(NULL AS TEXT) AS xvalv,
CAST(NULL AS TEXT) AS xvatdate,
CAST(NULL AS TEXT) AS xvvwa
FROM base
), final AS (
SELECT
CAST(mandt AS TEXT) AS mandt,
CAST(bukrs AS TEXT) AS bukrs,
waers,
periv,
ktopl,
land1,
kkber,
rcomp,
butxt,
spras
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
waers | None | Currency key |
periv | None | Fiscal year variant |
ktopl | None | Chart of accounts |
bukrs | None | Company code |
land1 | None | Country key |
kkber | None | Credit control area |
rcomp | None | Company |
butxt | None | Name of company code or company |
spras | None | Language key |
MANDT | TEXT | None |
BUKRS | TEXT | None |
WAERS | TEXT | None |
PERIV | TEXT | None |
KTOPL | TEXT | None |
LAND1 | TEXT | None |
KKBER | NUMBER | None |
RCOMP | NUMBER | None |
BUTXT | TEXT | None |
SPRAS | TEXT | None |
This SQL query selects all columns and rows from the table 'TEST.sap.t001' without any modifications or filtering. It appears to be a simple extraction of the entire table's contents.
OtherSELECT
*
FROM TEST.sap.t001
Name | Type | Comment |
---|---|---|
BUKRS | TEXT | None |
MANDT | NUMBER | None |
BUTXT | TEXT | None |
ORT01 | TEXT | None |
LAND1 | TEXT | None |
WAERS | TEXT | None |
SPRAS | TEXT | None |
KTOPL | TEXT | None |
WAABW | NUMBER | None |
PERIV | TEXT | None |
KOKFI | NUMBER | None |
RCOMP | NUMBER | None |
ADRNR | NUMBER | None |
STCEG | TEXT | None |
FIKRS | NUMBER | None |
XFMCO | NUMBER | None |
XFMCB | NUMBER | None |
XFMCA | NUMBER | None |
TXJCD | NUMBER | None |
FMHRDATE | NUMBER | None |
BUVAR | NUMBER | None |
FDBUK | NUMBER | None |
XFDIS | TEXT | None |
XVALV | TEXT | None |
XSKFN | NUMBER | None |
KKBER | NUMBER | None |
XMWSN | NUMBER | None |
MREGL | NUMBER | None |
XGSBE | TEXT | None |
XGJRV | TEXT | None |
XKDFT | TEXT | None |
XPROD | NUMBER | None |
XEINK | TEXT | None |
XJVAA | NUMBER | None |
XVVWA | NUMBER | None |
XSLTA | NUMBER | None |
XFDMM | TEXT | None |
XFDSD | TEXT | None |
XEXTB | NUMBER | None |
EBUKR | NUMBER | None |
KTOP2 | TEXT | None |
UMKRS | NUMBER | None |
BUKRS_GLOB | NUMBER | None |
FSTVA | NUMBER | None |
OPVAR | NUMBER | None |
XCOVR | NUMBER | None |
TXKRS | NUMBER | None |
WFVAR | NUMBER | None |
XBBBF | NUMBER | None |
XBBBE | NUMBER | None |
XBBBA | NUMBER | None |
XBBKO | NUMBER | None |
XSTDT | NUMBER | None |
MWSKV | TEXT | None |
MWSKA | TEXT | None |
IMPDA | NUMBER | None |
XNEGP | TEXT | None |
XKKBI | NUMBER | None |
WT_NEWWT | TEXT | None |
PP_PDATE | NUMBER | None |
INFMT | NUMBER | None |
FSTVARE | TEXT | None |
KOPIM | NUMBER | None |
DKWEG | NUMBER | None |
OFFSACCT | NUMBER | None |
BAPOVAR | NUMBER | None |
XCOS | NUMBER | None |
XCESSION | TEXT | None |
XSPLT | NUMBER | None |
SURCCM | NUMBER | None |
DTPROV | NUMBER | None |
DTAMTC | NUMBER | None |
DTTAXC | NUMBER | None |
DTTDSP | NUMBER | None |
DTAXR | NUMBER | None |
XVATDATE | NUMBER | None |
PST_PER_VAR | NUMBER | None |
XBBSC | NUMBER | None |
FM_DERIVE_ACC | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query performs a basic extraction and type casting operation on the 'stg_sap__t503_tmp' table. It selects specific columns from the source table, casts them to appropriate data types, and then creates a final selection of columns. The query doesn't perform any filtering, cleaning, deduplication, featurization, integration, or aggregation operations.
CleaningWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__t503_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS abart,
CAST(NULL AS TEXT) AS abtyp,
CAST(NULL AS TEXT) AS aksta,
CAST(NULL AS TEXT) AS ansta,
CAST(NULL AS TEXT) AS antyp,
CAST(NULL AS TEXT) AS austa,
CAST(NULL AS TEXT) AS burkz,
CAST(NULL AS TEXT) AS inwid,
CAST(NULL AS TEXT) AS konty,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS molga,
CAST(NULL AS TEXT) AS persg,
CAST(NULL AS TEXT) AS persk,
CAST(NULL AS TEXT) AS trfkz,
CAST(NULL AS TEXT) AS typsz,
CAST(NULL AS TEXT) AS zeity
FROM base
), final AS (
SELECT
mandt,
persg,
persk,
abart,
abtyp,
aksta,
ansta,
antyp,
austa,
burkz,
inwid,
konty,
molga,
trfkz,
typsz,
zeity
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
persg | None | Employee group |
persk | None | Employee subgroup |
abart | None | Employee subgroup grouping for personnel calculation rule |
abtyp | None | Employee subgroup grouping for primary wage tpyes |
aksta | None | Activity status |
ansta | None | Employment status |
antyp | None | Employee category |
austa | None | Training status |
burkz | None | Employee subgroup grouping for appraisal |
inwid | None | Participation in incentive wages |
konty | None | Employee subgroup grouping for time quota types |
molga | None | Reserved field/unused field of length 2 |
trfkz | None | ES grouping for collective agreement provision |
typsz | None | Single-character indicator |
zeity | None | Employee subgroup grouping for work schedules |
MANDT | TEXT | None |
PERSG | TEXT | None |
PERSK | TEXT | None |
ABART | TEXT | None |
ABTYP | TEXT | None |
AKSTA | TEXT | None |
ANSTA | TEXT | None |
ANTYP | TEXT | None |
AUSTA | TEXT | None |
BURKZ | TEXT | None |
INWID | TEXT | None |
KONTY | TEXT | None |
MOLGA | TEXT | None |
TRFKZ | TEXT | None |
TYPSZ | TEXT | None |
ZEITY | TEXT | None |
This SQL query selects all columns and rows from the table 'T503' in the 'sap' schema of the 'TEST' database. It is a simple select all statement without any filtering, transformation, or aggregation.
OtherSELECT
*
FROM TEST.sap.t503
Name | Type | Comment |
---|---|---|
MANDT | TEXT | None |
PERSG | TEXT | None |
PERSK | TEXT | None |
ABART | TEXT | None |
ABTYP | TEXT | None |
ANTYP | TEXT | None |
TRFKZ | TEXT | None |
ZEITY | TEXT | None |
AKSTA | TEXT | None |
ANSTA | TEXT | None |
AUSTA | TEXT | None |
KONTY | TEXT | None |
BURKZ | TEXT | None |
MOLGA | TEXT | None |
TYPSZ | TEXT | None |
INWID | TEXT | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |
This SQL query stages data from a temporary table 'TEST.PUBLIC_stg_sap.stg_sap__t880_tmp' into a more structured format. It defines the data types for various fields, although most are cast as NULL in this intermediate step. The final output selects only three columns (mandt, rcomp, and name1) from the structured data, with mandt being explicitly cast as TEXT.
CleaningOtherWITH base AS (
SELECT
*
FROM TEST.PUBLIC_stg_sap.stg_sap__t880_tmp
), fields AS (
SELECT
CAST(NULL AS BOOLEAN) AS _fivetran_deleted,
CAST(NULL AS DECIMAL(28, 6)) AS _fivetran_rowid,
CAST(NULL AS TIMESTAMP) AS _fivetran_synced,
CAST(NULL AS TEXT) AS city,
CAST(NULL AS TEXT) AS cntry,
CAST(NULL AS TEXT) AS curr,
CAST(NULL AS TEXT) AS glsip,
CAST(NULL AS TEXT) AS indpo,
CAST(NULL AS TEXT) AS langu,
CAST(NULL AS TEXT) AS lccomp,
CAST(NULL AS TEXT) AS mandt,
CAST(NULL AS TEXT) AS mclnt,
CAST(NULL AS TEXT) AS mcomp,
CAST(NULL AS TEXT) AS modcp,
CAST(NULL AS TEXT) AS name1,
CAST(NULL AS TEXT) AS name2,
CAST(NULL AS TEXT) AS pobox,
CAST(NULL AS TEXT) AS pstlc,
CAST(NULL AS TEXT) AS rcomp,
CAST(NULL AS TEXT) AS resta,
CAST(NULL AS TEXT) AS rform,
CAST(NULL AS TEXT) AS stret,
CAST(NULL AS TEXT) AS strt2,
CAST(NULL AS TEXT) AS zweig
FROM base
), final AS (
SELECT
CAST(mandt AS TEXT) AS mandt,
rcomp,
name1
FROM fields
)
SELECT
*
FROM final
Name | Type | Comment |
---|---|---|
mandt | None | Client |
rcomp | None | Company |
name1 | None | Company name |
MANDT | TEXT | None |
RCOMP | TEXT | None |
NAME1 | TEXT | None |
This SQL query selects all columns and rows from the table 'TEST.sap.t880' without any modifications or filtering. It is a straightforward data retrieval query that extracts the entire contents of the specified table.
OtherSELECT
*
FROM TEST.sap.t880
Name | Type | Comment |
---|---|---|
MANDT | TEXT | None |
RCOMP | TEXT | None |
NAME1 | TEXT | None |
CNTRY | TEXT | None |
NAME2 | NUMBER | None |
LANGU | TEXT | None |
STRET | TEXT | None |
POBOX | NUMBER | None |
PSTLC | TEXT | None |
CITY | TEXT | None |
CURR | TEXT | None |
MODCP | NUMBER | None |
GLSIP | NUMBER | None |
RESTA | NUMBER | None |
RFORM | NUMBER | None |
ZWEIG | NUMBER | None |
MCOMP | NUMBER | None |
MCLNT | NUMBER | None |
LCCOMP | NUMBER | None |
STRT2 | NUMBER | None |
INDPO | NUMBER | None |
_FIVETRAN_ROWID | TEXT | None |
_FIVETRAN_DELETED | BOOLEAN | None |
_FIVETRAN_SYNCED | TIMESTAMP_NTZ | None |