Just like to say thanks for the response and will try your suggestion - I already had one reply to my query as per below and know this works.
SELECT MyTable.*
FROM MyTable
LEFT JOIN (SELECT Oc_Id, Customer_Id FROM MyTable
WHERE Expire_Date > GETDATE()) Tbl1
ON...
Thanks - but not the solution - probably my poor attempt to explain the problem.
I do not want to select just oc_id = 10 .... there will be thousands of oc_ids but I only want oc_ids (this is a type of journal by the way) and within each group of journals there will be customers (customer_id)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.