You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Legolas wood <le...@gmail.com> on 2006/10/18 17:13:19 UTC

can we use a PK in where clause ?

Hi
thank you for reading my post
can we use a PK (which is composed of more than one column) in a where
clause ?
or better i ask how we can retrieve the PK values when they are composite

thanks

Re: can we use a PK in where clause ?

Posted by Michael Segel <ms...@mycingular.blackberry.net>.
Yes.
If your PK is colA,colB,colZ then in your where clause use
WHERE colA=?
AND colB=?
AND colZ=?

Followed by the rest of your where clause.   The optimizer should then choose the pk index.
Sent via BlackBerry.

-Mike Segel
Principal
MSCC
312 952 8175


-----Original Message-----
From: Legolas wood <le...@gmail.com>
Date: Wed, 18 Oct 2006 18:43:19 
To:Derby Discussion <de...@db.apache.org>
Subject: can we use a PK in where clause ?

Hi
thank you for reading my post
can we use a PK (which is composed of more than one column) in a where
clause ?
or better i ask how we can retrieve the PK values when they are composite

thanks