Query Formulation Question

Поиск
Список
Период
Сортировка
От
Тема Query Formulation Question
Дата
Msg-id 20060512223021.46448.qmail@web33311.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: Query Formulation Question  (Sean Davis <sdavis2@mail.nih.gov>)
Список pgsql-novice
consider the following simplified queries (php using
heredoc):

$sql_1 = <<<_EOSQL

select count(inspect)
from t_inspect, t_product, t_test_area
where t_product.product_num = 1
and t_test_area.id = 5

_EOSQL

$sql_2 = <<<_EOSQL

select count(inspect)
from t_inspect, t_product, t_test_area
where t_product.product_num = 1

_EOSQL

what is the best way to handle both of these cases in
one statement?

i know it would take the form of $sql_1, but what
value should i feed to t_test_area.id?  is there
syntax that will just ignore it or do i need to send a
value of 'NOT NULL'?  will NOT NULL slow down the
query when compared to $sql_2?

am i missing a better way to structure these queries?

as always, tia...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

В списке pgsql-novice по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Wondering if anyone could help me
Следующее
От: Sean Davis
Дата:
Сообщение: Re: Query Formulation Question