Quantcast
Channel: Query between two related tables - Database Administrators Stack Exchange
Browsing all 2 articles
Browse latest View live

Answer by Derek Downey for Query between two related tables

Use a LEFT JOIN and check for null values. Something like:SELECT profile.* FROM user_profile profile LEFT JOIN user_friend friend1 ON friend1.user_profile1_id = user_profile_id LEFT JOIN user_friend...

View Article



Query between two related tables

I have two tables. One of them (user_profile table) has a field named "user_profile_id" and the other one (user_friend table) has two fields named "user_profile1_id" and "user_profile2_id" which are FK...

View Article
Browsing all 2 articles
Browse latest View live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>