![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I inherited an Access 2003 database with this setup: TableOne TableOneId pocOne pocTwo 1 2 3 2 2 4 3 1 2 TableTwo TableTwoId Name 1 Jones 2 Smith 3 Edwards 4 Camden I currently have this query where I need to find all the records that match the criteria (Smith) and was wondering how I can eliminate the Union All and put it in one SQL: select * from TableTwo Inner Join TableOne on TableTwo.TableTwoId = TableOne.pocOne where Name = 'Smith' UNION ALL select * from TableTwo Inner Join TableOne on TableTwo.TableTwoId = TableOne.pocTwo where Name = 'Smith' |
#3
| |||
| |||
|
|
I inherited an Access 2003 database with this setup: TableOne TableOneId pocOne pocTwo 1 2 3 2 2 4 3 1 2 TableTwo TableTwoId Name 1 Jones 2 Smith 3 Edwards 4 Camden I currently have this query where I need to find all the records that match the criteria (Smith) and was wondering how I can eliminate the Union All and put it in one SQL: select * from TableTwo Inner Join TableOne on TableTwo.TableTwoId = TableOne.pocOne where Name = 'Smith' UNION ALL select * from TableTwo Inner Join TableOne on TableTwo.TableTwoId = TableOne.pocTwo where Name = 'Smith' |
#4
| |||
| |||
|
|
I inherited an Access 2003 database with this setup: TableOne TableOneId pocOne pocTwo 1 2 3 2 2 4 3 1 2 TableTwo TableTwoId Name 1 Jones 2 Smith 3 Edwards 4 Camden I currently have this query where I need to find all the records that match the criteria (Smith) and was wondering how I can eliminate the Union All and put it in one SQL: select * from TableTwo Inner Join TableOne on TableTwo.TableTwoId = TableOne.pocOne where Name = 'Smith' UNION ALL select * from TableTwo Inner Join TableOne on TableTwo.TableTwoId = TableOne.pocTwo where Name = 'Smith' |
![]() |
| Thread Tools | |
| Display Modes | |
| |