invalid relational operator
913576Jun 13 2012 — edited Jun 13 2012HI I am using oracle 10g and I am trying to get a count of unique dest by ID from two tables and I am trying to get unique cases from each table first however I am getting an error that says
invalid relational operator from the following query.
*This query runs if I just try to select distinct id, but not when I try to select distinct id and dest. Any help is much appreciated.
SELECT DISTINCT ID, DEST
FROM
(
SELECT DISTINCT FA.ID, A.AIRPORT_DESC AS DEST
FROM F_AIR_SEARCH FA, L_AIRPORT A
WHERE FA.DEST_AIRPORT_ID=A.AIRPORT_ID
AND FA.DAY_CODE>=SYSDATE -365
AND FA.POINT_OF_SALE_ID=1
AND FA.ID>0
AND A.AIRPORT_ID NOT IN (-99, 0)
)
where customer_prod_id, DEST NOT IN
(Select distinct s.id, A.AIRPORT_DESC as DEST
from f_car_search s, l_airport a, l_customer c, f_customer_div_subscription d
WHERE S.DAY_CODE >=SYSDATE - 365
AND S.CUSTOMER_PROD_ID>0
and s.point_of_sale_id in (2)
and S.DEST_AIRPORT_ID=A.AIRPORT_ID
and s.customer_prod_id=D.CUSTOMER_PROD_ID
and C.customer_prod_id = d.customer_prod_id
and c.effective_end_date = '31-Dec-9999'
and d.end_day_code = '31-Dec-9999'
and c.is_email_deliverable = 'Y'
and D.SUBSCRIPTION_STATE_ID = 1
and D.NEWSLETTER_DIVISION_ID =18)