Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Include table to aggregated update statement

$
0
0

I want to include receipt_link_id table to the below statement how can I achieve it???

UPDATE#arr                         SET rec_id =(SELECT max(dbo.recpt_status.recpt_id)AS aggr$1FROM dbo.recpt_status       WHERE dbo.recpt_status.membership_id =#arr.membership_id AND
                          dbo.recpt_status.receipt_status_type IN('P','U')AND
                          dbo.recpt_status.status_date =(SELECT max(dbo.recpt_status.status_date)FROM dbo.recpt_statusWHERE dbo.recpt_status.membership_id =#arr.membership_id AND
                                  dbo.recpt_status.rept_status_type IN('P','U')AND
                                  dbo.recpt_status.status_date <@l_dt_run ))

Viewing all articles
Browse latest Browse all 23857

Trending Articles