Is is possible to have multiple WHERE clauses in SELECT? - TechRepublic
Question
December 4, 2007 at 08:15 AM
tthomas

Is is possible to have multiple WHERE clauses in SELECT?

by tthomas . Updated 18 years, 7 months ago

If I have a table called “content_hits_tbl” and want to pull information, can’t i write something like this:

===============
SELECT COUNT(visitor_id) AS HITS, COUNT(DISTINCT visitor_id) AS VISITORS, COUNT(DISTINCT visitor_id) WHERE visit_type = 0 AS NEW, COUNT(DISTINCT visitor_id) WHERE visit_type = 1 AS RETURNING
FROM content_hits_tbl
===============

Can’t you have multiple WHERE clauses in the SELECT statement?

Any suggestions would be great. I have been wrestling with it and SQL queries arent my strong area …

I’m using VS05 connecting to a SQL database.

Sincerely,
Tommy

This discussion is locked

All Comments