Do you want to be a good Web Developer?

Enter Your Email To Get Our Exclusive Tutorials
And Offer Right In Your Email

MySQL Subquery

MySQL Subquery

Subquery is another query that is coded with in another query.You can code the subqueries in WHERE, HAVING, FROM or SELECT clause of a SELECT statements.



Example of Subquery

SELECT student_name from student_info where student_id = 
(SELECT id from student_marks where total_marks > 90 )

Code Explanation

  • In this example it select student_name from student_info table where the value of student_id is given by subquery
PrevNext

Join Us With Our 21000+ Subscribers And Get Our Latest Tutorials Update Via Email