Welcome Guest, Not a member yet? Register   Sign In
prefixing column names in return from SQL JOIN
#5

[eluser]m4rw3r[/eluser]
The result of
Code:
SELECT threads.* FROM threads LEFT OUTER JOIN posts ON threads.id = posts.threads_id
is the same as
Code:
SELECT * FROM threads
so that eliminates the benefits of a JOIN quite brutally Tongue .

This with aliases is a possibility I have considered, but then I have to use SHOW COLUMNS FROM ... 2x and then make some PHP processing assembling the query.

I need this (maybe not really, but it would make some performance improvements by limiting the number of queries) for my IgnitedRecord model (thanks to nmweb for the name :-) ).
The reason I need it is that I need to split the result into two objects, one for the requested object, the other for the related one.

But maybe the performance improvement is not necessary, I don't know.


Messages In This Thread
prefixing column names in return from SQL JOIN - by El Forum - 04-27-2008, 06:24 AM
prefixing column names in return from SQL JOIN - by El Forum - 04-27-2008, 07:17 AM
prefixing column names in return from SQL JOIN - by El Forum - 04-27-2008, 07:20 AM
prefixing column names in return from SQL JOIN - by El Forum - 04-27-2008, 08:02 AM
prefixing column names in return from SQL JOIN - by El Forum - 04-27-2008, 08:09 AM
prefixing column names in return from SQL JOIN - by El Forum - 04-27-2008, 08:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB