|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 7/25/2007 10:30:00 AM
Posts: 7,
Visits: 1
|
|
update tabl_name set id = ( sel id as SCI From cycle_Calendar Where cde ='AC' And id = (sel Min(id) From cycle_calendar Where cde = 'AC' And ST_cde = -20))
When I execute this query, I get Syntax error. Expected something between '(' and 'sel'
SPS
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 6/9/2008 2:55:55 PM
Posts: 185,
Visits: 2
|
|
That's an invalid syntax for Teradata. You cannot code a subselect within the SET clause of the UPDATE statement. Instead, you need to create a derived table and then use the column from the derived table in your set. Something like:
update tn from tabl_name ,( sel id as SCI From cycle_Calendar Where cde ='AC' And id = (sel Min(id) From cycle_calendar Where cde = 'AC' And ST_cde = -20)) dt set id = dt.SCI
Hope that helps.
|
|
|
|