September 2nd, 2013, 09:18 PM
I have a table which have the following columns
Id Member Access BossName
Abc123 Peter Admin Dan
Abc123 John User Marc
Abc123 Derek Admin Abby
Abc123 Dan User null
I am trying to come up with the query to see who are the Member with Admin access in a spefic ID and for the members with Admin access if their BossName is part of the same ID as a user or not.
For eg in the above as you see there are 2 members who are the Admin Peter and Derek. and Peter Boss Dan is a user as well in the same ID.
So in this case the query should return below exception report
Id : Abc123 Member : Derek BossNAMe : Abby
Any suggestions if this can be done using perl?
September 3rd, 2013, 09:06 AM
Is the question whether this can be done in perl, because I'm sure it can.
You can connect to a database and issue SQL queries, so yes. Is the question about whether a single SQL query do the whole job? Not sure.
Normally I would say yes, but it doesn't look like the example is normalized data. Dan is just a name, and not an uncommon one, so I wouldn't assume the first Dan is the same as the later Admin.
But certainly you can just select all where ID equals some group, and then perform any comparison you want in perl data structures..