
September 15th, 2004, 05:25 AM
|
|
Contributing User
|
|
Join Date: Aug 2004
Posts: 52
Time spent in forums: 8 h 1 m 11 sec
Reputation Power: 5
|
|
|
SQL query
Im trying to do a sql query whereby it will count the cust_id. The checking now is it will check the cust_id from 2 tables. customer and answer tbl whether the id appear in both table and whether survey_taken ='Y'. But if the cust_id did not appear in the customer tbl it will still return 0. I want to ensure that the customer appear in the customer tbl be4 he is allow to take the survey. Is there any other way I can do the query?
select count(O.cust_id) as cnt from customer C, answer O
where C.cust_id= O.cust_id and O.survey_taken='Y' and O.cust_id=8
|