Here is data in my table :
id name surname place
1 test1 isdad YES
2 test2 spreda YES
3 test3 me NO
4 test4 smallvile YES
What I’d like to get, all ids where place=’YES’. So Ids are
1
2
4
and the result count is 3. I want to append that number to the end of the results, so the result should look like this:
1
2
4
3
There is almost definitely a better way to do this. That said, you could do:
UNION ALLwill append the result number as a new row rather than attempting to add it as another column.Please don’t do this; the results will be mixed, it stands in stalwart defiance of good software design and will be baffling to anyone who comes along later and has to work on this piece of code.