RE: SQL: Brain Teaser

2003-08-14 Thread Robertson-Ravo, Neil (RX)
great for DBs which support t-sql stored procedures :-) -Original Message- From: Bill Grover [mailto:[EMAIL PROTECTED] Sent: 06 August 2003 14:05 To: CF-Talk Subject: RE: SQL: Brain Teaser If you wanted to do it all in SQL you can try the following. I would write it as a stored

RE: SQL: Brain Teaser

2003-08-14 Thread Tyler Clendenin
esday, August 06, 2003 7:46 AM To: CF-Talk Subject: RE: SQL: Brain Teaser > > USERS TABLE > > - > > USER_ID > > USERNAME > > etc... > > > > COMMENTS TABLE > > - > > COMMENT_ID > > USER_ID > > CO

Re: SQL: Brain Teaser

2003-08-14 Thread Jochem van Dieten
Tyler Clendenin wrote: > Well of course one can write a sp to do it but it would be so nice to just > have it in a single query. You can. You just have to declare the aggregate first (in most databases, MySQL even has it predefined). Jochem ~~~

RE: SQL: Brain Teaser

2003-08-14 Thread Tony Schreiber
; cfoutput to group I wish they would add group to cfloop at least then it > would be a little easier. > > Tyler Clendenin > GSL Solutions > > -Original Message- > From: Tony Schreiber [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 7:46 AM > To: CF-Tal

RE: SQL: Brain Teaser

2003-08-14 Thread Tony Schreiber
> > USERS TABLE > > - > > USER_ID > > USERNAME > > etc... > > > > COMMENTS TABLE > > - > > COMMENT_ID > > USER_ID > > COMMENT > > etc... > > > > I know I can query USERS and then loop through the results fetching > > the comments... but I'd rather not do that

RE: SQL: Brain Teaser

2003-08-14 Thread Robertson-Ravo, Neil (RX)
thats what its doing.SP;s are far more efficient anyway -Original Message- From: Tyler Clendenin [mailto:[EMAIL PROTECTED] Sent: 06 August 2003 14:21 To: CF-Talk Subject: RE: SQL: Brain Teaser Well of course one can write a sp to do it but it would be so nice to just have it in

RE: SQL: Brain Teaser

2003-08-14 Thread Bill Grover
ent: Wednesday, August 06, 2003 9:49 AM > To: CF-Talk > Subject: RE: SQL: Brain Teaser > > > Ah. But by "loop through results and fetch comments" I > thought you meant > something like query then loop and do a query for each user... > > What I wrote would be perfe

Re: SQL: Brain Teaser

2003-08-14 Thread Jochem van Dieten
Tyler Clendenin wrote: > Ahh if only there was a way to do that I would be so happy. Why wouldn't there be a way to do that? What DBMS are you using? Jochem ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid

RE: SQL: Brain Teaser

2003-08-14 Thread Bill Grover
20850-1299WWW:http://www.euservices.com __ > -Original Message- > From: Robertson-Ravo, Neil (RX) > [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 9:08 AM > To: CF-Talk > Subject: RE:

Re: SQL: Brain Teaser

2003-08-14 Thread Bud
SELECT U.UserID,Username,CommentID,Comment FROM Users U LEFT OUTER JOIN Comments C ON U.UserID = C.UserID Order By U.UserID, CommentID #UserID#,#UserName##Comment# >Perhaps this is easy for someone so I figured I'd ask. Here's the scenario: > >USERS TABLE >- >USER_ID >USERN

RE: SQL: Brain Teaser

2003-08-10 Thread Tyler Clendenin
Well of course one can write a sp to do it but it would be so nice to just have it in a single query. Tyler Clendenin GSL Solutions -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 7:59 AM To: CF-Talk Subject: Re: SQL: Brain Teaser

RE: SQL: Brain Teaser

2003-08-09 Thread Tyler Clendenin
Ahh if only there was a way to do that I would be so happy. Tyler Clendenin GSL Solutions -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 6:35 AM To: CF-Talk Subject: Re: SQL: Brain Teaser [EMAIL PROTECTED] wrote: > > USERS

RE: SQL: Brain Teaser

2003-08-08 Thread Bill Grover
ville, MD 20850-1299WWW:http://www.euservices.com __ > -Original Message- > From: Tyler Clendenin [mailto:[EMAIL PROTECTED] > Sent: Wednesday, August 06, 2003 8:58 AM > To: CF-Talk > Subject: RE: SQL: Brain Teas

RE: SQL: Brain Teaser

2003-08-08 Thread Robertson-Ravo, Neil (RX)
temp table and then select all from that table then drop? -Original Message- From: Tyler Clendenin [mailto:[EMAIL PROTECTED] Sent: 06 August 2003 13:58 To: CF-Talk Subject: RE: SQL: Brain Teaser That would do it but not from sql. I know really don't like having to use cfoutput to

RE: SQL: Brain Teaser

2003-08-08 Thread Tyler Clendenin
Ahh if only there was a way to do that I would be so happy. Tyler Clendenin GSL Solutions -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 6:35 AM To: CF-Talk Subject: Re: SQL: Brain Teaser [EMAIL PROTECTED] wrote: > > USERS

RE: SQL: Brain Teaser

2003-08-07 Thread Tyler Clendenin
esday, August 06, 2003 7:46 AM To: CF-Talk Subject: RE: SQL: Brain Teaser > > USERS TABLE > > - > > USER_ID > > USERNAME > > etc... > > > > COMMENTS TABLE > > - > > COMMENT_ID > > USER_ID > > CO

RE: SQL: Brain Teaser

2003-08-07 Thread Tony Schreiber
___ > > > > > -Original Message- > > From: Tony Schreiber [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, August 06, 2003 9:49 AM > > To: CF-Talk > > Subject: RE: SQL: Brain Teaser > > > > > > Ah. But by "loop through results

RE: SQL: Brain Teaser

2003-08-07 Thread Tyler Clendenin
Well of course one can write a sp to do it but it would be so nice to just have it in a single query. Tyler Clendenin GSL Solutions -Original Message- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 06, 2003 7:59 AM To: CF-Talk Subject: Re: SQL: Brain Teaser

Re: SQL: Brain Teaser

2003-08-06 Thread Jochem van Dieten
[EMAIL PROTECTED] wrote: > > USERS TABLE > - > USER_ID > USERNAME > etc... > > COMMENTS TABLE > - > COMMENT_ID > USER_ID > COMMENT > etc... > > I know I can query USERS and then loop through the results fetching the > comments... but I'd rather not do that