mercredi 23 décembre 2015

SQL query, check if cells with the same value in column A have the same value in column B

I have a table with a lot of columns and rows such as the below example :

Example table for query

What I want my query to do is that it takes all values in the "Order" column and looks if all the items lines from one order have a goods issue date. The result that I wish from this query is that it gives me orders that are incomplete, such as part of the item lines have a goods issue date and part do not have. I can easily get orders with no goods issue date but I need to know the orders that have some items lines with a date and some without so that I can get a list of incomplete orders. (I hope I formulated correctly and it is understandable)

As an example, if we apply the query to the above table, it would give me only the order no 1 (not the 3 because it doesn't have any item lines with a date.).

I hope my question is not confusing. I appreciate any kind of help, even if it is links telling me to study that topic or some other.

Thanks in advance everybody :)

Aucun commentaire:

Enregistrer un commentaire