sql - Returning rows that has matching record in another table -


I have table students with student ID and student names. I have table events with table id, student ID and event.

Now, I want to write a query that will return only the rows from the student table, in which the student ID is present in the event table.

I'm running MySql 5 +.

Join and besides you you can also use EXISTS

  

Comments

Popular posts from this blog

objective c - iPhone and it's wireless area -

unix - Listing all shared memory segments used by a process on AIX5.3+ -

tsql - Correct sql/hql query (aggregate in where clause) -