mysql - Query to find out solution for finding difference rows of two table -


tablea (master data)       (productcode, rate) tableb (transaction data)  (productcode, rate, qty) 

i want see whole row rate alter while selling (transaction data tableb)

example:

tablea (master data)

productcode        rate  1000               50       2000               100     3000               200     

tableb (transaction data)

productcode        rate  1000               50       2000               90    3000               200     

expected result:

tableb

productcode        rate     2000               90  

thanks in advance

if want rows have same productcode different rate need this:

select * tableb  tableb.rate <> (select tablea.rate tablea tablea.productcode = tableb.productcode) 

or

select tableb*  tableb inner join tablea on tableb.productcode = tablea.productcode tableb.rate <> tablea.rate 

Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -