sql - joining two tables with a condition -


i explain question example

i have 2 tables:

1- scales(id, name, min_grade, max_grade, college_id)

2- college(id, name)

i want search 2 tables , records when scales.name = "name" , college.name="name" (same name) following condition college.id must exist in first table(scales.college_id) record second one.

what proper query that?

thanks in advance.

you're looking join: http://www.w3schools.com/sql/sql_join.asp

select * scales inner join college on scales.college_id = college.id scales.name = "somename" 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -