Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I want where not and where

Data

     Load

          Price,

          Ref.1,

          Ref.2

     SQL

          "Price",

          "Ref.1",

          "Ref.2"

FROM "MIS_DataLake_UAT".dbo."SAP_COST";

where Ref.1='WAG' and not match (Ref.2,2,3)

where Ref.1 not match ('OIL')

EX.

PriceRef.1Ref.2

200

OIL-
300--
400COST-
500WAG1
600WAG2
700WAG3
800WAG4
900OIL1
1000COST2

Result

PriceRef.1Ref.2
300--
400COST-
500WAG

1

800WAG4
1000COST2

I write incorrect.

What Should I write ?

Sum({$<[Warehouse.S_TOD] = {'TOD1'}>} and {$<[S_VEND_ID] = {'702'}>} distinct(total))

Sum({$<[Warehouse.S_TOD] = {'TOD1'}>} and {$<[S_VEND_ID]  not  {'702'}>} distinct(total))

Capture.PNG

Thank You for answer question.

1 Solution

Accepted Solutions
Gysbert_Wassenaar

Sum({$<[Warehouse.S_TOD] = {'TOD1'}, [S_VEND_ID] = {'702'}>} Price)

Sum({$<[Warehouse.S_TOD] = {'TOD1'}>,[S_VEND_ID]  -= {'702'}>} Price)


talk is cheap, supply exceeds demand

View solution in original post

5 Replies
Gysbert_Wassenaar

Sum({$<[Warehouse.S_TOD] = {'TOD1'}, [S_VEND_ID] = {'702'}>} Price)

Sum({$<[Warehouse.S_TOD] = {'TOD1'}>,[S_VEND_ID]  -= {'702'}>} Price)


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

I load data from SQL but I want to load some data  and I have Problem following


FROM "MIS_DataLake_UAT".dbo."SAP_COST"

where "S_ACCOUNT" = ('68001000','52001500','68119000','68002000'),

where "S_SESSION_NAME" <> ('ARF0214DMSAR','ARF0114DMSAR','APF0214DMSAP','APF0114DMSAP','APF0114ADVAP','APF0114AD2AP'),

where "S_REF_KEY_1" <> ('OIL'),

where "S_REF_KEY_1" = 'WAG' and "S_REF_KEY_2" <> (2,3);

Capture.JPG

Anonymous
Not applicable
Author

Problem

Capture.JPG

Gysbert_Wassenaar

MS SQL Server doesn't understand the SQL statement you send it. There's a syntax error in it. Most SQL dialects only support one single Where clause. And if you're using multiple conditions you need to use the AND of OR keyword to specify how the conditions should be combined. Try this SQL tutorial: SQL Tutorial


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

thank you