Double query - Mailing list pgsql-sql

From PostgreSQL Admin
Subject Double query
Date
Msg-id 47AA2015.2060506@productivitymedia.com
Whole thread Raw
In response to Re: Sql ORDER BY and ASC/DESC question  (Gregory Stark <stark@enterprisedb.com>)
Responses Re: Double query
List pgsql-sql
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 nulldate      | date
     |day       | smallint               |status    | boolean                | not nullopen      | 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


pgsql-sql by date:

Previous
From: Thomas Kellerer
Date:
Subject: Re: Columns view? (Finding column names for a table)
Next
From: johnf
Date:
Subject: Information schema permissions