SELECT a.* FROM works AS a WHERE a.userid=15 INNER JOIN users AS b ON a.userid=b.id;
Something is just wrong and I don't know why, someone could offer some help please ? Thank you
How to Select All Records from One Table That Do Not Exist in Another Table in SQL? We can get the records in one table that doesn't exist in another table by using NOT IN or NOT EXISTS with the subqueries including the other table in the subqueries.
Yes, you can! The longer answer is yes, there are a few ways to combine two tables without a common column, including CROSS JOIN (Cartesian product) and UNION. The latter is technically not a join but can be handy for merging tables in SQL.
You join two tables by creating a relationship in the WHERE clause between at least one column from one table and at least one column from another. The join creates a temporary composite table where each pair of rows (one from each table) that satisfies the join condition is linked to form a single row.
Your WHERE
clause is in the wrong position. It always follows all tables listed and joined in the FROM
clause.
SELECT a.*
FROM
works AS a
INNER JOIN users AS b ON a.userid=b.id
WHERE a.userid=15 ;
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