Hi Sowmya,
To query for all users who are not assigned any role in Ariba, you may use count and having with group by clause of SQL. This is completely SQL concept. Below query will result you list of all users, who are not assigned to any role in your system.
select UniqueName,count("Roles".UniqueName) from ariba.user.core.User group by UniqueName having count("Roles".UniqueName) = 0
Please feel free to reach me if you still have any concerns.
Amit