Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Optimizer question

Status
Not open for further replies.

groleau

Programmer
Apr 12, 2006
110
US
I need to standardize some fields in a staging table before selecting some of them to put in a permanent table.

Can I depend on the UPDATE happening before the SELECT or must I say GO between the two to ensure that non-standardized input fields are evaluated correctly in the SELECT ?

thanks

--
Wes Groleau
 
If you execute multiple sql statements in sequence in a single command, they will not run concurrently.
 
please show the query"

Using the short names from another post:
Code:
UPDATE S
SET    A = 
       CASE  -- abbreviate name
       WHEN A LIKE '%subgroup%' THEN 'subgroup'
       WHEN (list of others)
       ELSE 'main' -- or use main if no subname present
       END

INSERT INTO K (C, D)
SELECT A, B
FROM   S
LEFT JOIN K
     ON   A = C
     AND ... WHERE ... etc.

--
Wes Groleau
 
Thanks. Not worried about concurrency--(input S and update K) is a periodic automation and K is read-only for everyone else.

--
Wes Groleau
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top