I am trying to find out unique rows from the given data
In my case I am storing buy sell of the stock in stock table. So same client can buy sell same stock.
So ask is to just fetch stocks which are only BUY and not SELL by any other client.
Here is the sqlFiddle link where I have shared table structure and query I tried
http://sqlfiddle.com/#!9/df117d/2
I am expecting result as –
STOCKB
STOCKD
STOCKE
2
Answers
You can do:
See SQLFiddle
This is an other way to do it using
group by
andhaving
clause, where total should equal total rows with flag BUY :Demo here