In this query i want to count the number of occurances the staffid is = to the the page id (sometimes its not) is it possible to put in if statements?
SELECT first_name
,last_name
,page
,page_id
,staffid
FROM usertrack
,staff
WHERE page='/staff_details.cfm'
AND staff_id=staffid
if pageid=staffid count(*) AS ownvisit
SELECT first_name
,last_name
,page
,page_id
,staffid
FROM usertrack
,staff
WHERE page='/staff_details.cfm'
AND staff_id=staffid
if pageid=staffid count(*) AS ownvisit