0% found this document useful (0 votes)
4 views2 pages

Script

The document contains a SQL query that retrieves pricing and distributor information from a database. It selects various fields related to price structures, including secondary and primary prices, effective dates, and unit measures for specific SKUs. The query filters results based on a specific effective date and a list of SKUs.

Uploaded by

aleek6404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Script

The document contains a SQL query that retrieves pricing and distributor information from a database. It selects various fields related to price structures, including secondary and primary prices, effective dates, and unit measures for specific SKUs. The query filters results based on a specific effective date and a list of SKUs.

Uploaded by

aleek6404
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

SELECT ps.DISTRIBUTOR,dt.Name,convert(varchar, dt.

WORKING_DATE, 105) WORKING_DATE,


ps.SKU, ps.PRICE_STRUC,
PRICE_UNIT1 AS 'SECONDARY PRICE CS', PRICE_UNIT2 AS 'SECONDARY PRICE DZ',
PRICE_UNIT3 AS 'SECONDARY PRICE PC',
PRICE_PURCHASE1 AS 'PRIMARY PRICE CS',PRICE_PURCHASE2 AS 'PRIMARY PRICE
DZ',PRICE_PURCHASE3 AS 'PRIMARY PRICE PC',
bc.SELL_FACTOR1 as [Seconday UOM CS], bc.SELL_FACTOR2 as [Secondary UOM DZ],
bc.SELL_FACTOR3 as [Secondary UOM PC],
bc.PURCHASE_FACTOR1 as [Primary UOM CS], bc.PURCHASE_FACTOR2 as [Primary UOM DZ],
bc.PURCHASE_FACTOR3 as [Primary UOM PC],
convert(varchar, EFFECTIVE_DATE, 105) EFFECTIVE_DATE,convert(varchar,
EFFECTIVE_TODATE, 105) EFFECTIVE_TODATE, ps.GST_REGISTERED, ps.GST_NREGISTERED
FROM PRICE_STRUCTURE ps
join batch bc on ps.sku = bc.sku and ps.COMPANY = bc.COMPANY
left join DISTRIBUTOR dt on dt.DISTRIBUTOR = ps.DISTRIBUTOR
where
EFFECTIVE_DATE IN '20250908'
AND ps.SKU IN
('21133329',
'64767114',
'64767116',
'64785330',
'64840278',
'64875203',
'64892650',
'64892653',
'64892656',
'64947100',
'64947106',
'64947112',
'64947118',
'64947124',
'64947131',
'64947137',
'64947143',
'64947300',
'64947307',
'64947313',
'64947319',
'64947325',
'64947332',
'64947338',
'64947344',
'64948009',
'64948016',
'64948022',
'64948029',
'64953995',
'64954001',
'64954018',
'64954020',
'64960765',
'64960771',
'64960777',
'64960783',
'64960789',
'64960795',
'64987261',
'64987268',
'65067513',
'65067525',
'65067531',
'65067537',
'65067543',
'65086637',
'65086641',
'65218554',
'65218557',
'65218560',
'65218563',
'65218566',
'65218569',
'65218572',
'65218575',
'65221149',
'65234364',
'65234368',
'65234372',
'65234464',
'65243406',
'65243413',
'65243420',
'65243990',
'65243993',
'65248686',
'65248690',
'65248694',
'65254314',
'65426411',
'65428006',
'68542102',
'68718670',
'69583229',
'69583247',
'69743970',
'69743987')

You might also like