I have written a query in which i am getting result like this.
nid | target_id
2570 | 748
2570 | 756
2570 | 756
2570 | 756
2571 | 799
2572 | 785
I have tried count and group by but my result is like
nid | target_id
2570 | 4
2571 | 1
2572 | 1
Now I want to write some query to get result something like this
nid | target_id | count(target_id)
2570 | 748 | 1
2570 | 756 | 3
2571 | 799 | 1
2572 | 785 | 1
And then get all the nid whose count is greater than 1. I have tried many queries but not find a luck to find the solution. Any help will be appreciated
group bywithhavingto filter out the cases where count is greater than 1. Also, do a group by ofnidandtarget_id