Join TalkersCode Now !

Get Latest Tutorials And Links On Web Development
And Get Existing Offers Via 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

Are You Starting A New Blog
Do You Want Best Web Hosting?

Try World's Best Web Hosting Provider BlueHost
At Just $3.95/mo

Hurry Up! Limited Time Offer

Yes, I Want To Check Out BlueHost

Check The World's Best SEO And All-In-One Marketing Toolkit
For Digital Marketing Professionals SEMRUSH

Check Out SEMRUSH