Darkness Soul Posted December 1, 2006 Share Posted December 1, 2006 Yo, :DI've been testing querys and come to a conclusion.. [b]a INNER JOIN b[/b] is slow then [b]FROM a,b[/b], at my search query, i've seen the timing.. using inner join, its take 0.8~s, using the other way, its take 0.6~s. ;)So, if I have this code t1 below, and go to make the code t2 below, how I do to use LEFT JOIN?[code]-- t1Select * From a Inner Join b On a.id = b.id_a Left Join cOn c.id = b.id_c-- t2Select *From a, b, cWhere a.id = b.id_aAnd c.id = b.id_c -- This is like inner, how do I a left here?[/code]Thank you.. :DD.Soul Quote Link to comment Share on other sites More sharing options...
fenway Posted December 3, 2006 Share Posted December 3, 2006 I'm not sure I understand... you want to rewrite t2 as a join? So what's t1 all about? Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted December 4, 2006 Author Share Posted December 4, 2006 I've learned to use joins to "group" tables, but my senior said the t1 style is more simple, so I gonna test and this performance was better then joins, but with stress test, I've look its not really true.. joins are stable, if a join use 3s to execute a query, it'll take 2.8~3.2.. but the other style of code may use 1s~8s.. so I keep with joins, to me they are easy and safe.But my question was about the use of LEFT JOIN, let me se how be clear.. hmm.. (finding words)If I have a news with image.. like:select a.*, b.image from tbnews a left join tbimages b on b.id = a.idimage..and want to make it without joins.. like:select a.*, b.image from tbnews a, tbimages b where b.id = a.idimage..! its work fine with inner join, but don't know how to use with left joins..better now? :') i'm trying hardD.Soul Quote Link to comment Share on other sites More sharing options...
fenway Posted December 6, 2006 Share Posted December 6, 2006 You can't "make" a left join without JOIN syntax... it's an accident that comma works, it never should. Quote Link to comment Share on other sites More sharing options...
artacus Posted December 6, 2006 Share Posted December 6, 2006 Yeah, use t1. What you have in t2 will end up biting you as you write more complex queries. Quote Link to comment Share on other sites More sharing options...
Darkness Soul Posted December 6, 2006 Author Share Posted December 6, 2006 I see!Thank you for the knowledge. :)D.Soul Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.