Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Select Failed 3706: Syntax error: expected something between the word 'sasnref' and the word 'EXCEPTION' - response (1) by dnoeth

$
0
0

Did you work with DB2 before?
EXCEPTION JOIN is no Standard SQL (unless it was recently introduced).
 
When you need data from the 2nd table you can rewrite it using a LEFT JOIN plus a WHERE join_column_from_right_table IS NULL.
In your case it's probably better to use a NOT EXISTS.
 
Some additional remarks:
trx_date is a timestamp? Then better CAST(trx_date as DATE) instead of a formatted CHAR(8) for the join condition, you'll loose any existing statistics on that column and if it's a partitioning column, there's no partition elimination anymore.
And depending on your release you might also consider WHERE trx_date >= timestamp  '2013-05-01 00:00:00' and trx_date < timestamp  '2013-05-02 00:00:00'
Moving the "where (uplink + downlink) > 5242880" in the Derived Table as "HAVING (uplink + downlink) > 5242880" might also result in a better plan
 
Dieter
 


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>