I have a table like the one below.
I need to form a select query. I'm going to pass a
SELECT SNo FROM Register WHERE RefID = 1
And beside the
SNo in the Statement, I need to have another column which contains the total
refID belonging to that
SNo. For example:
The Precise Question as @JNK Specified:
Show me all the Sno values with a RefID of 1, and for each Sno show me also a count of how many times that Sno value is itself used as a RefID anywhere else in the table.