On Wed, 06 Feb 2008 16:01:09 -0500 PostgreSQL Admin <[EMAIL PROTECTED]> wrote: > I want to find any value: > > SELECT id FROM schedule WHERE clinic_id = '%s' AND date = '%s' > > But I want to make sure the clinic exist first then find if the date > exist 2nd.
I'm not sure what you mean by "first" and "second" but if you mean that you want a list of all clinics that match the clinic ID and you want to know of all of those which ones have the specified date then perhaps this is what you want. SELECT id, date = '%s' FROM schedule WHERE clinic_id = '%s'; -- D'Arcy J.M. Cain <[EMAIL PROTECTED]> | Democracy is three wolves http://www.druid.net/darcy/ | and a sheep voting on +1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner. ---------------------------(end of broadcast)--------------------------- TIP 3: Have you checked our extensive FAQ? http://www.postgresql.org/docs/faq