|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Query Question
Hello,
I have 3 tables as followed: Person ------- ID Name GroupPerson ------------ ID GroupId PersonId Group ------ ID GroupName I want to find all of the Group items that have a groupName like '%b%' and that has a Person with a name like '%g%' and I want to be able to display the name of the group and the person. Does anyone know how to do this? |
|
#2
|
|||
|
|||
|
I don't know how you have defined relationship between the tables.
i assumed that id in person is same as personid in groupperson, id in group is same as groupid in person. the query is select g.groupname,p.name from person p, groupperson r, Group g where p.id=r.personid and g.id=r.groupid and g.groupname like '%b%' and p.name like '%g%'; |
|
#3
|
|||
|
|||
|
Quote:
Thank you very much. I forgot to make one of the links between the tables. That was why I was getting way too many results. Thanks again. |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Query Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|