RE: SQL distinct

2005-11-02 Thread Mosh Teitelbaum
Stuart: You need to use an INNER JOIN in your query. The query should be: SELECT u.userID, u.firstName, u.lastName, e.eventID, e.userID FROM tbl_020publicUsers u INNER JOIN tbl_020eventDetails e ON u.userID = e.userID HTH -- Mosh

Re: SQL distinct

2005-11-02 Thread Michael Traher
that is because you are getting the event details as well e.eventID and e.userID if you remove these from the select list and put the DISTINCT back that should do the trick. Mike T On 11/2/05, Saturday (Stuart Kidd) [EMAIL PROTECTED] wrote: Hi guys, I'm trying to do something simple but

RE: SQL distinct

2005-11-02 Thread Ian Skinner
cfquery name=GetUsers datasource=user020 SELECT u.userID, u.firstName, u.lastName, e.eventID, e.userID FROM tbl_020publicUsers u, tbl_020eventDetails e WHERE u.userID = e.userID /cfquery By selecting e.eventID from the tbl_020eventDetails e table, every row selected is going to be distinct. A

RE: SQL distinct

2005-11-02 Thread Hassan Arteaga
Hi Stuart Try Inner Join with the key in each table IE: Imagine u have two tables Basket and basketDetails in an ecommerce application SELECT* FROM_C_Basket INNER JOIN _R_BasketDetails ON _C_Basket.idBasket = _R_BasketDetails.idBasket In this

RE: SQL distinct

2005-11-02 Thread Ian Skinner
The original OP did have an inner join using the older style of putting the join in the WHERE clause. If he is on a system like me, using an older Oracle 8i or previous version, he can't use the new fangled (13 year old) syntax of INNER JOIN, OUTER JOIN, FULL JOIN, CROSS JOIN. Oh how I wish I

Re: SQL distinct

2005-11-02 Thread Saturday (Stuart Kidd)
Thanks for all your help on that one guys :) All working now. On 2 Nov 2005, at 19:36, Hassan Arteaga wrote: Hi Stuart Try Inner Join with the key in each table IE: Imagine u have two tables Basket and basketDetails in an ecommerce application SELECT* FROM

RE: SQL DISTINCT Question

2002-04-18 Thread Sam Roach
try: SELECT email, first(firstname), first(lastname) FROM people GROUP BY email; -- Sam -Original Message- From: Jeff Green [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 4:15 PM To: CF-Talk Subject: SQL DISTINCT Question SELECT DISTINCT Email FROM LinkedEmails returns a

RE: SQL DISTINCT Question

2002-04-18 Thread Jeff Green
: RE: SQL DISTINCT Question try: SELECT email, first(firstname), first(lastname) FROM people GROUP BY email; -- Sam -Original Message- From: Jeff Green [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 4:15 PM To: CF-Talk Subject: SQL DISTINCT Question SELECT DISTINCT Email

RE: SQL DISTINCT Question

2002-04-18 Thread Sam Roach
creative :) -- Sam -Original Message- From: Jeff Green [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 18, 2002 4:55 PM To: CF-Talk Subject: RE: SQL DISTINCT Question Thanks Sam, got the following to work but I like yours better ;) SELECT Email, FirstName, LastName FROM Users WHERE

RE: sql distinct

2001-11-02 Thread Pascal Peters
Doesn't the distinct work for the whole select and not just the first field? -Original Message- From: Michael Vinson [mailto:[EMAIL PROTECTED]] Sent: donderdag 1 november 2001 16:45 To: CF-Talk Subject: sql distinct My distinct is no longer distinct after a simple, but major, change.

RE: sql distinct

2001-11-02 Thread Andy Ewings
. -Original Message- From: Pascal Peters [mailto:[EMAIL PROTECTED]] Sent: 02 November 2001 10:28 To: CF-Talk Subject: RE: sql distinct Doesn't the distinct work for the whole select and not just the first field? -Original Message- From: Michael Vinson [mailto:[EMAIL PROTECTED]] Sent