September 21, 2005 at 10:36 am
Hello...
How can make one UPDATE SETENCE using internally a clause of Order.
Something like
UPDATE authors
SET @Var = STATE = @Var + 1
FROM (SELECT TOP 10 * FROM authors ORDER BY au_lname) AS t1
WHERE authors.au_id = t1.au_id
But without Top beacuse in necesary update all the records but by order.
September 21, 2005 at 10:56 am
From your example, I didn't figure out why you need to enforce the order. But if you really need it, you can try (SELECT TOP 100 PERCENT * FROM authors ORDER BY au_lname) AS t1
September 21, 2005 at 11:32 am
Why not just add an identity column to the table??
September 21, 2005 at 2:13 pm
Thank you friends select top 100 PERCENT is the best correct solution, to my problem thaks for all.
September 21, 2005 at 2:18 pm
So how did the identity solution turned out??
September 21, 2005 at 2:22 pm
Really the solution Identity does not work because the example not is really equal to the Sentence SQL that I need. Really not is only add 1 to the previous value.
But thanks RGR'us
September 21, 2005 at 2:28 pm
You might be interested by this thread :
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=189202
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply