4 messages in com.mysql.lists.javaMay I appeal to primary key without k...
FromSent OnAttachments
Evgeniy Strokin18 Feb 2003 08:54 
Michael Widenius25 Feb 2003 03:28 
Evgeniy Strokin26 Feb 2003 05:46 
Evgeniy Strokin27 Feb 2003 10:42 
Subject:May I appeal to primary key without knowing name of it?
From:Michael Widenius (mon@mysql.com)
Date:02/25/2003 03:28:27 AM
List:com.mysql.lists.java

Hi!

"Evgeniy" == Evgeniy Strokin <evge@yahoo.com> writes:

Evgeniy> Hi, Evgeniy> Is it possible to make such query and run it via JDBC: Evgeniy> Select * from tableName where primary_key = 123 Evgeniy> Primary_key is not name of column. In fact I don’t Evgeniy> know what is name of primary key. But I know only that Evgeniy> primary key should be = 123. Evgeniy> Another words: may I appeal to primary key without Evgeniy> knowing name of it?

You can do:

SELECT * from table_name WHERE _rowid=123

_rowid is in MySQL an alias for the primary key...

Regards, Monty