back soft

مطالب مرتبط با «mysql select all records» در back soft | نویسنده: استخدام کار

MySQL Select all records

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...

ادامه مطلب

برچسب‌های مرتبط

mysql select all records | mysql select all records not in another table | mysql select all records from today | mysql select all records from yesterday | mysql select all records from one table and some from another | mysql select all records between two dates | mysql select all records from two tables | mysql select all records in a table | mysql select all records for current month | mysql select all records when no value is supplied