List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:July 10 2002 2:08am
Subject:Re: query to update record by the position of row
View as plain text  
In the last episode (Jul 09), Pichan M. said:
> Is there a query to update record by specify the position of record
> or row?
> 
> update tableA set col_name = "somthing" ...( at row number 123)

SQL tables do not have row numbers.  The only way to absolutely
identify a record is by a unique ID in the record.

SQL queries have row numbers, but the only way to guarantee a
particular record appears in the same row every time you do the query
is by adding an "ORDER BY unique_column" clause.

Just add an INTEGER AUTO_INCREMENT column to your table and use that
when you want a particular record.

-- 
	Dan Nelson
	dnelson@stripped
Thread
query to update record by the position of rowPichan M.10 Jul
  • Re: query to update record by the position of rowDan Nelson10 Jul