"JOHN MEYER" <[EMAIL PROTECTED]> wrote: > > > So I can do something like "SELECT * FROM " . $tablename . "WHERE _rowid=" > $id (I'm using PHP and the primary key is a unique integer column in each of > the tables).
Yes. For example: mysql> CREATE TABLE t1(id int NOT NULL PRIMARY KEY); Query OK, 0 rows affected (0.02 sec) mysql> INSERT INTO t1 VALUES(1),(2),(3); Query OK, 3 rows affected (0.00 sec) Records: 3 Duplicates: 0 Warnings: 0 mysql> SELECT * FROM t1 WHERE _rowid=2; +----+ | id | +----+ | 2 | +----+ 1 row in set (0.00 sec) >>From: Egor Egorov <[EMAIL PROTECTED]> >>To: [EMAIL PROTECTED] >>Subject: Re: Primary keys >>Date: Wed, 24 Mar 2004 13:28:58 +0200 >> >>"JOHN MEYER" <[EMAIL PROTECTED]> wrote: >> > Is there a way to do a SQL Select and get a record without specifying >>the >> > primary key. Example. I have two tables CANDLE and VOTIVES. Can I >>define >> > a select that says "SELECT * FROM TABLE WHERE PRIMARY_KEY="... >> > >> >>No, You can't. >>Only if PRIMARY or UNIQUE KEY consists of one integer column, you can refer >>to that column as _rowid: >> http://www.mysql.com/doc/en/CREATE_TABLE.html -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]