Re: O'Reilly interview with Date
Date: 10 Aug 2005 19:39:17 -0700
Message-ID: <1123727957.178638.97420_at_g14g2000cwa.googlegroups.com>
Kenneth Downs wrote:
> Marshall Spight wrote:
>
> >>
> >> SELECT child.* from parent join child key KEYNAME
> >
> > Okay, but this doesn't address the namespace unification issues
> > that I raised previously.
>
> Why not?
create table Users(
UserId int primary key,
Login varchar(32)
);
If I'm preparing a report for defect 123, I probably want to show the Login of the owner and reporter, instead of the numeric id. So I might do this
Select
BugId, Title,
ownerUser.Login as OwnerLogin,
reporterUser.Login as ReporterLogin
from
Bugs, Users ownerUser, Users reporterUser
where
BugId = 123 AND
Owner = ownerUsers.UserId AND
Reporter = reporterUsers.UserId;
I use a column naming discipline here, to good effect. SQL doesn't require me to, but I do it anyway.
Marshall Received on Thu Aug 11 2005 - 04:39:17 CEST