hello, I had a search query as mentioned below: select p.serial_number from products p left merge join (select distinct(serial_number) from rare_items) ri on ri.serial_number = p.serial_number where p.serial_number = 20 when i run this query it gives the followgin error message: Msg 8622, Level 16, State 1, Line 1 Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN. If in the where clause i donot use serial_number then no any error message displayed. plz can anybody help me find out the root cause... and the best solution for this, i have no other options than using left merge join
can you try sub query with order by Serial_Number as merge join requires data to be sorted on both tables