|
|
Archives of the TeradataForum
Message Posted: Wed, 28 Sep 2011 @ 10:03:00 GMT
Subj: | | Re: How to Fetch tables from Database with different suffixes |
|
From: | | Maccha, Narayana |
Sravan,
SELECT SUBSTRING(TRIM(tablename)
FROM CHARACTER_LENGTH(TRIM(tablename)) -3 FOR 4)
from dbc.tables where tablename='oldpasswords_2409';
You can use above query and compare the results to the data you want
Exp
select tablename from dbc.tables
where SUBSTRING(TRIM(tablename)
FROM CHARACTER_LENGTH(TRIM(tablename)) -3 FOR 4)='HIST';
select tablename from dbc.tables
where SUBSTRING(TRIM(tablename)
FROM CHARACTER_LENGTH(TRIM(tablename)) -3 FOR 4)='HIST';
*** Query completed. 643 rows found. One column returned.
*** Total elapsed time was 1 second.
TableName
------------------------------
CL_XX_XXXXXXXXXX_HIST
PARTY_XXXXXXXXXXXXXX_HIST
Thanks and regards,
Machha
Teradata DBA
| |