Wednesday, May 31, 2006

Teradata Basic command on Date & Time

1.To select date
Select Date

2.To select time
Select time

3. To find the number of days between two date
select (date '2006-12-31'- date '2006-01-01' );

Teradata Query to display nth Record

To select nth row from Teradata database table,u can use the below specified query

SEL * FROM (
SELECT sum(1) over (rows unbounded preceding) As ROW_ID
,columns FROM databasename.tablename
) a WHERE ROW_ID = n ;


Note:
update the above query(marked as red) with ur database related info.

Thanks