Simple question - but my brain is not working:

This is my table
Column | Type | Modifiers -----------+------------------------+----------------------------------------------------------------- id | integer | not null default nextval('emr_clinicschedule_id_seq'::regclass)
clinic_id | integer                | not null
date      | date                   |
day       | smallint               |
status    | boolean                | not null
open      | time without time zone |
close     | time without time zone |
reason    | character varying(64)  |
active    | boolean                | not null

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.

How do I do that?

Thanks in advance,
J

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org

Reply via email to