this is the first time I'm dabbling in Databases and was wondering if it was possible to do the following: I have two tables
student (id, name, phone)
photos (id, student_id, photo)
I wanted to retrieve the student phone who's name is say 'Tom' but only if he has a photo. Is it possible at all to have a condition like this?
Many thanks
select s.phone from student s
inner join photos p
on p.student_id=s.id
where p.photo is not null
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With