Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use Ads
- select lower(anu.Name) as UserName, count(anu.Name) AdsCount,
- case when anr.Name = 'Administrator' then 'yes'
- else 'no'
- end IsAdministrator
- from Ads a
- left join AspNetUsers anu ON a.OwnerId = anu.Id
- left join AspNetUserRoles anur ON anu.id = anur.UserId
- left join AspNetRoles anr ON anur.RoleId = anr.Id
- group by anu.Name, anr.Name
- order by UserName
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement