Re: A Complicated Group Query

2004-06-23 Thread SGreen
otmail.com> cc: Fax to:

Re: A Complicated Group Query

2004-06-22 Thread shaun thornburgh
L PROTECTED] To: "shaun thornburgh" <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: A Complicated Group Query Date: Tue, 22 Jun 2004 14:32:14 -0400 OOPS! That's because my second query should have been a LEFT JOIN and not a RIGHT JOIN (I hate making silly cut-and-paste error

Re: A Complicated Group Query

2004-06-22 Thread SGreen
Fax to:

Re: A Complicated Group Query

2004-06-22 Thread shaun thornburgh
s! I hope you can help me here, many thanks! From: [EMAIL PROTECTED] To: "shaun thornburgh" <[EMAIL PROTECTED]> CC: [EMAIL PROTECTED] Subject: Re: A Complicated Group Query Date: Tue, 22 Jun 2004 10:12:22 -0400 Hi Shaun, You said: >SELECT COUNT(B.Booking_ID), U.User_Location

Re: A Complicated Group Query

2004-06-22 Thread SGreen
Fax to: 06/22/2004 09:41 Subject: A Complic

A Complicated Group Query

2004-06-22 Thread shaun thornburgh
Hi, I have three tables (among others!) in my database; Bookings, Users and Projects. Users have location codes and can make bookings which are for a particular project. Using the following query I can get a list of all Locations (Each user has a Location code) and the number of Bookings that h

Re: Group Query

2004-06-22 Thread shaun thornburgh
<[EMAIL PROTECTED]> CC: [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: Re: Group Query Date: Tue, 22 Jun 2004 10:56:12 +0200 Shaun, when you add "WHERE B.Project_ID > = '10'" you, in a way, change your LEFT JOIN to an INNER JOIN. You need to do it like: LEFT OUTER JOI

Re: Group Query

2004-06-22 Thread Johan Hook
P BY(U.User_Location); Any ideas, do I need to do a double join, or do I need to join the projects table also? Thanks for your help From: "Paul McNeil" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: RE: Group Query Date: Fri, 18 Jun 2004 08:20:10 -0400 You can use a Left

RE: Group Query

2004-06-22 Thread shaun thornburgh
ct_ID = '8' GROUP BY(U.User_Location); Any ideas, do I need to do a double join, or do I need to join the projects table also? Thanks for your help From: "Paul McNeil" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Subject: RE: Group Query Date: Fri, 18 Jun 2004 08

RE: Group Query

2004-06-18 Thread Paul McNeil
UP BY(U.User_Location); God Bless Paul C. McNeil Developer in Java, MS-SQL, MySQL, and web technologies. GOD BLESS AMERICA! To God Be The Glory! -Original Message- From: shaun thornburgh [mailto:[EMAIL PROTECTED] Sent: Friday, June 18, 2004 7:54 AM To: [EMAIL PROTECTED] Subject:

Re: Group Query

2004-06-18 Thread Johan Hook
Hi, you can use: SELECT COUNT(B.Booking_ID), User_Location FROM Users U LEFT JOIN Bookings B ON U.User_ID = B.User_ID GROUP BY(U.User_Location); /Johan shaun thornburgh wrote: Hi, The following table produces a query that shows all bookings that user has made and groups the number of bookings by t

Group Query

2004-06-18 Thread shaun thornburgh
Hi, The following table produces a query that shows all bookings that user has made and groups the number of bookings by the users location code. mysql> SELECT COUNT(B.Booking_ID), User_Location FROM Bookings B, Users U WHERE U.User_ID = B.User_ID GROUP BY(U.User_Location); At the momnet if no

Re: order/group query

2003-02-05 Thread Diana Soares
Yes, You can use the FIELD() function: SELECT * FROM table WHERE recordID IN ($string) ORDER BY FIELD(recordID,$string) On Tue, 2003-02-04 at 13:15, Wilbert Enserink wrote: > Hi All, > > I have a string containing recordID's in a specific order (e.g. > $string=17,2,33,5,99) > How can I select

Re: order/group query

2003-02-05 Thread Roger Baklund
* Wilbert Enserink > I have a string containing recordID's in a specific order (e.g. > $string=17,2,33,5,99) > How can I select those records from a table in the right order (as > determined in $string)? > > SELECT * FROM table WHERE recordID IN ($string) > > results in the right records but not

order/group query

2003-02-04 Thread Wilbert Enserink
Hi All, I have a string containing recordID's in a specific order (e.g. $string=17,2,33,5,99) How can I select those records from a table in the right order (as determined in $string)? SELECT * FROM table WHERE recordID IN ($string) results in the right records but not in the order I want, ins