No, he's using the WHERE clause to perform the join. It works, but it is a bad habit to get into, and doesn't scale well (maintenance wise, and possibly performance wise) when used with a larger number of tables.
On Tue, 1 Feb 2005 21:16:38 -0600, Peter Brunone <[EMAIL PROTECTED]> wrote: > > > Isn't he using an inner join already? > > -----Original Message----- > From: Dean Fiala [mailto:[EMAIL PROTECTED] > > Use an alias on at least one of the columns in your select statment, > that is what is causing the ambiguous column name. > > Also you would be better served using an inner join, though that is not > the issue. > > Select table1.username t1User, table2.username t2User > FROM table1 inner join table2 on table1.accountNum = table2.accountNum > > On Tue, 1 Feb 2005 16:48:19 -0500, Mike Appenzellar > <[EMAIL PROTECTED]> wrote: > > > > I have a query with multiple tables, that being said there is the same > > > field in both tables...ex: > > > > Select table 1.username, table 2.accountNum > > FROM table 1, table 2 > > WHERRE table 1.accountNum = table 2.accountNum > > > > table 1 > > - id > > - accountNum > > - username > > > > table2 > > - id > > - accountNum > > - name > > > > When I bind the query to a datagrid, I get "Ambiguous column name". > > Any ideas? > > Yahoo! Groups Links > > > > > -- Dean Fiala Very Practical Software, Inc http://www.vpsw.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
