|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/1/2008 8:33:51 AM
Posts: 2,
Visits: 11
|
|
could anyone help me
whats wrong with this query in teradata
why query is not working though sub query seperately is working perfectly
SELECT * FROM (SELECT 'prod_rplic_test.'|| tablename FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1)
Thanks
|
|
|
|
|
Junior Member
      
Group: Forum Members
Last Login: Yesterday @ 2:48:50 PM
Posts: 24,
Visits: 80
|
|
Umm... try this!
SELECT 'prod_rplic_test.'|| tablename FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1;
The additional subquery is not required as a SELECT * will simply return everything from your subquery anyway!
Alternativley if you need to add restrictions:
SELECT
*
FROM (
SELECT
'prod_rplic_test.'|| tablename
FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List
WHERE counter=1
) a (colA)
--ADD ADDITIONAL WHERE CONDITIONS/JOINS HERE
;
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/27/2008 6:28:51 AM
Posts: 2,
Visits: 1
|
|
I think.......
bcoz u didn't specify alias to the subquery.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/1/2008 8:33:51 AM
Posts: 2,
Visits: 11
|
|
[quote]could anyone help me
whats wrong with this query in teradata
why query is not working though sub query seperately is working perfectly
SELECT count(*) FROM
(SELECT 'prod_rplic_test.'|| tablename FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1)
My idea behind this is, I have tabulated all database tables in table prod_rplic_test.ETL_VALIDATION_M7_Table_List
now I want to have record count on each table
so first with where counter=1, i am pointing to first table
and next using some loop i can point out next tables
So, if my query above works, that will be really wonderful
Any great gurus Help plzzz
Thanks
Rams
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 11/23/2008 11:25:35 PM
Posts: 76,
Visits: 148
|
|
can you give the error code?
-SN
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 9/5/2008 10:50:05 AM
Posts: 7,
Visits: 25
|
|
3707 syntax error some')' is missing
but i tried all possible options, still not working
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 8/25/2008 7:28:58 AM
Posts: 2,
Visits: 9
|
|
Hi ,
Try this.
SELECT temp.tabname FROM
(SELECT 'prod_rplic_test.'|| tablename as tabname FROM prod_rplic_test.ETL_VALIDATION_M7_Table_List WHERE counter=1) as temp
Regards,
Arun
|
|
|
|