Vote count: 0 I have to tables: user and userimages. Right now, I'm using the following query: SELECT * FROM users u INNER JOIN userimages ui ON u.id=ui.userid; Yes. It retrieved the records if the userid and id is equal. What I really want to do is to select all records from table users even if its id is not present on the second table (userimages) My question is how to select all records in the users table with or withou userid on the second table? asked 4 mins agosilent_coder14 1 Answer Vote count: 0 You're looking for a LEFT JOIN, which will pull all rows from the first table and join where applicable to the right. SELECT * FROM users u LEFT JOIN userimages ui ON u.id=ui.userid; answered...
ادامه مطلب