Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
muvvasiva
Starting Member
14 Posts |
Posted - 2009-06-23 : 07:11:49
|
| hi ALL,temp table has the following dataID MENUID READPERMISSION WRITEPERMISSION MODIFYPERMISSION== ====== =============== ================ ================1...4........Y................N.................N2...4........N................N.................Y3...4........Y................N................ N4...5........Y................N................ NI placed dots between the values for redabilityHere , i have to select distinct MENUID from this table.After selection i should get the data as follows.ID MENUID READPERMISSION WRITEPERMISSION MODIFYPERMISSION=== ====== ============== ================ =================1.....4...........Y................N...................Y4.....5...........Y................N...................Nin the above data(before selection) MENUID=4 has 3 rows In any row for MENUID=4 if READPERMISSION field has value 'Y' then i need to select 'Y'similarlly for WRITEPERMISSION and MODIFYPERMISSION fields also.Pls help me |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-06-23 : 07:16:38
|
So basically, what you are telling us, is that the YES permission has higher presedence than NO permission?SELECT MIN(ID), MenuID, MAX(ReadPermission), MAX(WritePermission), MAX(ModifyPermission)FROM Table1GROUP BY MenuID E 12°55'05.63"N 56°04'39.26" |
 |
|
|
muvvasiva
Starting Member
14 Posts |
Posted - 2009-06-23 : 07:25:10
|
| Hello peso, Thank u very much |
 |
|
|
|
|
|