- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Price | Ref.1 | Ref.2 |
---|---|---|
200 | OIL | - |
300 | - | - |
400 | COST | - |
500 | WAG | 1 |
600 | WAG | 2 |
700 | WAG | 3 |
800 | WAG | 4 |
900 | OIL | 1 |
1000 | COST | 2 |
Result
Price | Ref.1 | Ref.2 |
---|---|---|
300 | - | - |
400 | COST | - |
500 | WAG | 1 |
800 | WAG | 4 |
1000 | COST | 2 |
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))
Thank You for answer question.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thank you