Mysql query - one row details, child rows |
[eluser]boltsabre[/eluser]
You want to do a right join (it will return all rows of data from table b where you join "ON" criteria matches even if there is no match in table a). http://www.w3schools.com/sql/sql_join_right.asp Not sure if active records can do a right join, you'll have to investigate that yourself, but otherwise, native sql isn't that hard to code! |
Messages In This Thread |
Mysql query - one row details, child rows - by El Forum - 06-20-2012, 05:59 AM
Mysql query - one row details, child rows - by El Forum - 06-20-2012, 06:40 AM
Mysql query - one row details, child rows - by El Forum - 06-20-2012, 06:56 AM
Mysql query - one row details, child rows - by El Forum - 06-20-2012, 07:22 AM
Mysql query - one row details, child rows - by El Forum - 06-20-2012, 07:47 AM
Mysql query - one row details, child rows - by El Forum - 06-20-2012, 07:50 AM
|