Query Formulation Question - Mailing list pgsql-novice

From
Subject Query Formulation Question
Date
Msg-id 20060512223021.46448.qmail@web33311.mail.mud.yahoo.com
Whole thread Raw
Responses Re: Query Formulation Question
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Wondering if anyone could help me
Next
From: Sean Davis
Date:
Subject: Re: Query Formulation Question