finding missing values, mysql??

Posted by praveenmon on Stack Overflow See other posts from Stack Overflow or by praveenmon
Published on 2011-01-04T04:35:50Z Indexed on 2011/01/04 4:53 UTC
Read the original article Hit count: 170

Filed under:
|
|

i am using mysql database i have a table called sales its primary key is sales_id

-------------------------------------
sales_id | invoice_id | 
-------------------------------------

1    |  147 
2    |  148
3    |  150

for sales-id 3 the invoice is supposed to be 149. i want to know which numbers are missing from invoice_id (i start invoice_id is 147 and end invoice_id is 4497). The invoice_id had no relation with sales_id

is it possible to know which numbers are missing from invoice_id, using some queries??

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql