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 |
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2011-04-14 : 21:44:38
|
| Dear All,How can i get below output from this 2 table?Thank you.Table A--------ID Menu CanAccess ( 1 / 0 )1 Test 02 Go 03 Jum 04 Ki 05 Pa 0Table B--------ID CanAccess ( 1 / 0)2 14 15 1Output------1 Test 02 Go 13 Jum 04 Ki 15 Pa 1Regards,Micheale |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-04-14 : 22:01:35
|
[code]select ID, Menu, max(CanAccess)from( select ID, Menu, CanAccess from TableA union all select ID, NULL, CanAccess from TableB) dgroup by ID, Menu[/code] KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
micnie_2020
Posting Yak Master
232 Posts |
Posted - 2011-04-14 : 22:20:35
|
| Dear KH Tan,Tqvm.Regards,Micheale |
 |
|
|
|
|
|