Click here to Skip to main content
15,891,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello..I have two queries that result two result sets i need to compare both the result sets and need to display the differences between them.Hope i will get good support.Thank you.These are my queries

Query:1
SQL
SELECT distinct c.sid_ident,c.fix_ident
   from corept.std_sid_leg as c
   INNER JOIN
   (
      SELECT sid_ident, transition_ident, max(sequence_num) seq, route_type
      FROM corept.std_sid_leg
      WHERE data_supplier='J' AND airport_ident='KBOS'
      GROUP BY sid_ident,transition_ident
   ) b ON c.sequence_num=b.seq
       and c.sid_ident = b.sid_ident
       and c.transition_ident = b.transition_ident
    WHERE c.data_supplier='J' and c.airport_ident='KBOS'
Query:2
SELECT
  name,
  trans
FROM skyplan_deploy.deploy_sids
ON d.name=c.sid_ident
WHERE apt = 'KBOS'
  AND name != trans 


As Mysql doesnt support full outer join,I thought of using left join and right join and combine both the results.But i stuck up with this.Please help.I am getting syntax error while using left and right join.Thank you.
Posted
Updated 20-Mar-13 22:57pm
v2

1 solution

 
Share this answer
 
Comments
Sujitha1705 21-Mar-13 5:16am    
But Mysql doent support full outer join.You provided me a tutorial on that which is of no use to me at this situation.Thank you
Zoltán Zörgő 21-Mar-13 6:11am    
No, you have not read it fully. The first query is made with full outer join, but the following ones are alternatives to it, that does not use full outer join. Please, be more careful, before rejecting an answer.

But queries cane not be transformed automatically, please formulate your first query in English to have a clear view on what you want to get as result. You also don't have to write a single closed query statement, you can achieve the same result with views, stored procedures and temporary tables.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900