I have a table with an ordering field, which might have values like
this:

Product Name    Product Order
foo             5
bar             12
baz             19

I want to update this table so it looks like this:

Product Name    Product Order
foo             10
bar             20
baz             30

So all the order numbers are neatly spaced out.

The easy way would be to do a CFQUERY ordered by Product Order, then
loop over that and do an update for each row, setting the order to
currentRow * 10.. but that seems like too much DB activity to me.

Is there a way this can be done in a single SQL update statement?

I'm on MS SQL Server 2000 btw.

thanks, bye!

-----------------------
Ryan Sabir
Newgency Pty Ltd
2a Broughton St
Paddington 2021
Sydney, Australia
Ph (02) 9331 2133
Fax (02) 9331 5199
Mobile: 0411 512 454
http://www.newgency.com/index.cfm?referer=rysig 


---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to