Author |
Topic |
puppy
Starting Member
5 Posts |
Posted - 2013-12-17 : 03:12:45
|
for the below mentioned query their is repetition of rows with the same data.Please helpSELECT srs.prod_area as PA,srs.art as ArtNo,b.adsc_unicode as ArtName, cast(case when a.unit <> '2' then c.avsx/10 else c.avsx/1000 end as integer(2)) as AwsMHS, cast(srs.estimate/10 as integer(1)) as AwsSRSThisWeek,cast(case when a.unit <> '2' then c.exws/10 else c.exws/1000 end as integer(2)) as ExpSale, a.palq as PalletQty,a.mdq as MinDeliveryQty,skf.min_salesplace_size as MinSalesspaceSize,skf.min_qty_for_direct_flow as MinQtyForDirectFlow,CAST(skf.MATH_SAFETY_STOCK as integer(1) )as MathSafetyStock,Decode(skf.salesplace_flow_type, NULL, 'Not in SRS', '0', 'Missing', '1', 'Too small', '2', 'Indirect', '3', 'Direct', '4', 'Too big', skf.salesplace_flow_type) as FlowType,skf.sugg_salesplace_size as SuggestedSize,c.bulk as SalesMethod,a.auto as StockRepl,a.stpo as SalesLocation,a.mupq as MultipackQty, a.salesspace_code as SalesSpaceCode,a.salesplace_size as SalesSpaceCapacity,skf.lowest_sales_qty as LowestSalesQty, skf.max_salesplace_size as MaxSalesplaceSize,a.goods_dom as QtyGoodsDom,si.from_date as FromDate,si.to_date as ToDate,si.MSG_CODE_TEXT || si.FREE_TEXT as CentralSalesInfo,a.delivery_max as DelMaxfrom srs_key_figures skf, srs_articles srs, iwaaa a, iwaab b, iwaac c, availability_msg siwhere c.bulk in ('0','1','2') and b.iso = 'SE'and srs.art = c.artand srs.art = b.artand srs.art = a.artand srs.art = skf.art (+)and srs.art = si.item_noorder by srs.prod_area, srs.art; |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2013-12-17 : 03:26:19
|
Are you using Oracle or SQL Server?Its just that if you want people to re-write your code, they are likely to rewrite it in T-SQL on this site and you might be better off visiting an Oracle forum if you want the code someone writes to work for you. |
 |
|
puppy
Starting Member
5 Posts |
Posted - 2013-12-17 : 04:04:13
|
Im using SQL Server |
 |
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2013-12-17 : 04:26:06
|
Decode() is Oracle, not SQL Server, so think you may need to check what you are using. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-12-17 : 07:54:54
|
your posted code is in Oracle as I can see below..si.MSG_CODE_TEXT || si.FREE_TEXT ..and srs.art = skf.art (+).. which are not supported in T-SQL------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
 |
|
|
|
|