phpgroupware-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Phpgroupware-developers] db (was class.acl + mysql)


From: Chris Weiss
Subject: Re: [Phpgroupware-developers] db (was class.acl + mysql)
Date: Sat, 15 Apr 2006 19:43:05 +0000

On 4/14/06, Dave Hall <address@hidden> wrote:
> Also for many left joins, I think the syntax is messy and not as clear
> to read as just using a simple WHERE tbl1.tbl_id = tbl2.tbl1_id  Maybe
> that is just me.

i used to think this too, but I've been using JOIN more and it's just
a matter of getting used to it.  Also, "WHERE tbl1.tbl_id =
tbl2.tbl1_id" is considered the "old" way.  for instance, mssql 2005
will issue warnings when using this type of join unless you set an
older db compat mode.  and for outer joins it's the only standard way,
and combining the 2 forms can get quite confusing.

I'm certainly not suggesting that we go replace all WHERE's with
JOIN's, or even making a motion to require using JOIN going forward
(yet), but I definatly don't see anything unclear with it, it just
takes a little getting used to.  a bit formating can help a lot, I've
standardized on this in my own code:
FROM
  t1 JOIN t2 ON t1.id = t2.id
     JOIN t3 ON t1.f1 = t3.id

it's actualy nice becuase you get the table def and the join
conditions right next to each other, which can definatly make things
easier when dealing with 5+ tables (i have a couple with more than 10
tables)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]