Skip to Content
0

help with a hana query

Mar 16, 2017 at 06:02 PM

24

avatar image
Former Member

Hello, for all i have one little problem using hanna i have this query

SELECT T0."CodeBars", T0."ItemCode", T0."ItemName", T0."U_ARGNS_MOD", T2."U_Year",T3."U_Desc",T4."U_Desc",T0."U_ARGNS_SIZE", CASE WHEN T0."U_ARGNS_SIZE"='06M' THEN T1."OnHand" END As "6M", CASE WHEN T0."U_ARGNS_SIZE"='12M' THEN T1."OnHand" END As "12M", CASE WHEN T0."U_ARGNS_SIZE"='18M' THEN T1."OnHand" END As "18M", CASE WHEN T0."U_ARGNS_SIZE"='002' THEN T1."OnHand" END As "2", CASE WHEN T0."U_ARGNS_SIZE"='02A' THEN T1."OnHand" END As "02A", CASE WHEN T0."U_ARGNS_SIZE"='003' THEN T1."OnHand" END As "3", CASE WHEN T0."U_ARGNS_SIZE"='03X' THEN T1."OnHand" END As "3X", CASE WHEN T0."U_ARGNS_SIZE"='03A' THEN T1."OnHand" END As "3A", CASE WHEN T0."U_ARGNS_SIZE"='3XA' THEN T1."OnHand" END As "3XA", CASE WHEN T0."U_ARGNS_SIZE"='004' THEN T1."OnHand" END As "4", CASE WHEN T0."U_ARGNS_SIZE"='006' THEN T1."OnHand" END As "6", CASE WHEN T0."U_ARGNS_SIZE"='008' THEN T1."OnHand" END As "8", CASE WHEN T0."U_ARGNS_SIZE"='010' THEN T1."OnHand" END As "10", CASE WHEN T0."U_ARGNS_SIZE"='012' THEN T1."OnHand" END As "12", CASE WHEN T0."U_ARGNS_SIZE"='014' THEN T1."OnHand" END As "14", CASE WHEN T0."U_ARGNS_SIZE"='016' THEN T1."OnHand" END As "16", CASE WHEN T0."U_ARGNS_SIZE"='16X' THEN T1."OnHand" END As "16X", CASE WHEN T0."U_ARGNS_SIZE"='018' THEN T1."OnHand" END As "18", CASE WHEN T0."U_ARGNS_SIZE"='0CH' THEN T1."OnHand" END As "CH", CASE WHEN T0."U_ARGNS_SIZE"='0MD' THEN T1."OnHand" END As "M", CASE WHEN T0."U_ARGNS_SIZE"='0GD' THEN T1."OnHand" END As "G", CASE WHEN T0."U_ARGNS_SIZE"='0XG' THEN T1."OnHand" END As "EG", CASE WHEN T0."U_ARGNS_SIZE"='XCH' THEN T1."OnHand" END As "XCH", CASE WHEN T0."U_ARGNS_SIZE" NOT IN ('0XG','0GD','0MD','0CH','018','16X','016','014','012','010','008','006','004','03X','003','3XA','03A','002','02A','18M','12M','06M','XCH') THEN T1."OnHand" END As "OTRAS", T0."AvgPrice", T0."LastPurPrc", T0."LstEvlPric" FROM OITM T0 INNER JOIN OITW T1 ON T0."ItemCode" = T1."ItemCode" left join "SBO_CAPPINI"."@ARGNS_MODEL" T2 on T0."U_ARGNS_MOD" =T2."U_ModCode" left join "SBO_CAPPINI"."@ARGNS_COLLECTION" T3 on T2."U_CollCode" = T3."U_CollCode" left join "SBO_CAPPINI"."@ARGNS_AMBIENT" T4 on T2."U_AmbCode"= T4."U_AmbCode" where T1."WhsCode"='PT001' and T0."U_ARGNS_MOD"='CH05003E5' AND T1."OnHand">0

and the result is

field 1|field2|field3|field4|......

model1|size1| |

model1| |size2|

model1| |size4

the other models are below the last size, if i use the grup by i have an error i want to see the query like this:

field 1|field2|field3|field4|......

model1|size1|size2|size3|

model2|0 |size2| 0 |

model3|size1|size2|size3|

i try all the ways that i know but i can´t solve this, can any one help me? thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers