php - Oracle connect three tables in SQL query -


i using oracle database , php.i have 3 tables:

| users  |         | user/group |          | groups  | ----------         --------------          ----------- | u_id   |         | gr_id      |          | gr_id   | | u_name |         | u_id       |          | gr_name | |u_status|         |            |          |         | 

i need names of users in group has gr_name , has status...say 'ok'; have tried using join so:

select u_name users      join user/group on user.u_id = user/group.u_id     join groups on user/group.gr_id = groups.gr_id u_status = 'ok' 

the query return users in groups.. how , can insert like:

where gr_name = 'blah-blah' 

try

where u_status = 'ok' , gr_name = 'blah-blah'


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -