Double query
| От | PostgreSQL Admin |
|---|---|
| Тема | Double query |
| Дата | |
| Msg-id | 47AA2015.2060506@productivitymedia.com обсуждение исходный текст |
| Ответ на | Re: Sql ORDER BY and ASC/DESC question (Gregory Stark <stark@enterprisedb.com>) |
| Ответы |
Re: Double query
|
| Список | 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 по дате отправления: