I am wondering why this is not working. I have a table of order line items. each order can have multiple line items with the same transaction ID just different item codes.
I am trying to find single transaction ID's with a specific item code. I also tried doing a count (transactionnumber)<2 but could not figure out how to add a where for the item number.
So an order for just this item
select distinct(transactionnumber) from Orders (I thought this would select any unique transaction number IE only one occurance)where Code='9987'
When I run the above and check the transaction numbers it is any transaction with that code not transactions with only that code?
I also tried this
select * from OrdersWhere (select COUNT(transactionnumber)from Device_Orders) <2 and ItemCode='9987'
This returns no records when I know there are single transaction numbers with that item code?
Any suggestions would be appreciated