![]() |
Active Record + Join SQL Problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Active Record + Join SQL Problem (/showthread.php?tid=15922) Pages:
1
2
|
Active Record + Join SQL Problem - El Forum - 02-28-2009 [eluser]darkhouse[/eluser] I must correct my initial statement. There actually IS a way to do this with SQL, and I didn't realize it. You can use a UNION. It's pretty simple really: Code: SELECT * FROM table1 Now, this should combine everything and order them all by the timestamp, BUT it might also combine other columns that shouldn't necessarily be combined. I'm not sure how to fix that exactly, just wanted you to be aware of it if it might be a problem for you. Active Record + Join SQL Problem - El Forum - 02-28-2009 [eluser]PV-Patrick[/eluser] Thanks for the correction darkhouse! ![]() ![]() Active Record + Join SQL Problem - El Forum - 02-28-2009 [eluser]darkhouse[/eluser] Yeah I was wondering what your schema was like, and thought it could probably be written a little better. Usually if you find you need to something a little unorthodox it means you're doing something wrong. Glad you sorted it out. |