Quantcast
Channel: SCN: Message List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 8968

SQL syntax for deleting in TMPTAB based on DBTAB

$
0
0

In a stored procedure I have table DBTAB and an internal temporary table #TMPTAB containing the following:

 

DBTAB

Product (key)Other Release Date
PROD1...01102014
PROD2...NULL
PROD3...NULL

 

#TMPTAB

Product (key)Product Group (key)Date (key)Amount
PROD1A30092014100
PROD1A01102014110
PROD1A02102014120
PROD2B30092014200
PROD2B01102014210
PROD2B02102014220

 

The question is: what is the SQL syntax to delete those entries in #TMPTAB with a corresponding Date prior to the Release Date in DBTAB when the Release Date <> NULL.

 

The result in the above example would be that the first line and only the first line in #TMPTAB is deleted.

 

I appreciate any assistance on this. Thanks.


Viewing all articles
Browse latest Browse all 8968

Trending Articles