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

Select Tables created in a previous months only - response (4) by mohan.mscss

$
0
0
Here it is.. SELECT databasename as DBNAME, tablename as TBLNAME, CAST(createtimestamp AS DATE FORMAT 'YYYY-MM-DD')(CHAR(10)) as CREATE_DATE                                                FROM DBC.TABLES                                                         WHERE DBNAME = 'DB1' AND Tablekind='T' AND createtimestamp >= ADD_MONTHS(DATE - EXTRACT(DAY FROM DATE) + 1, -1) AND createtimestamp <= (DATE - EXTRACT(DAY FROM DATE))                ORDER BY 1;    

Viewing all articles
Browse latest Browse all 27759

Trending Articles



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