* Daniel Rossi > Hi there i was wondering if there was anyway to determine the > primary key field instead of explicitly setting it in an update > sql query ? > > for instance i'd like to go update table *** where primarykey=1 > instead of where id=1 as the primary key is named differentrly > for each table and i'm trying to create a global data manager, > let me know thanks.
Since 3.23.11 you can use _rowid as an alias for an integer type unique indexed column: <URL: http://www.mysql.com/doc/en/News-3.23.11.html > mysql> use test Database changed mysql> create table testrowid (x int not null primary key); Query OK, 0 rows affected (0.38 sec) mysql> insert into testrowid values (1),(2),(3); Query OK, 3 rows affected (0.02 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> select * from testrowid where _rowid=2; +---+ | x | +---+ | 2 | +---+ 1 row in set (0.00 sec) -- Roger -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]