Just a day ago, I was was asked this question in one of the teaching session to my team members. One of the member asked me if I can use DISTINCT in Aggregate Function and does it make any difference.
Of course! It does make difference. DISTINCT can be used to return unique rows from a result set and it can be used to force unique column values within an aggregate function.
SELECT SUM(DISTINCT ReorderPoint) ResultDistinct
SELECT SUM(ReorderPoint) ResultNoDistinct
Reference : Pinal Dave (https://blog.sqlauthority.com)
Its very urgent..
I have a table called Permissions. in that I have iParentID, iPermissionID there….if I give the iParentId=1, suppose this record having the iPermissionId s 6,7,8. I need to display hirarchy wise…
can anyone help me regarding this