RE: Problems with select distinct

2005-01-26 Thread Gustafson, Tim
-4185 Fax http://www.meitech.com/ -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Wednesday, January 26, 2005 12:08 AM To: Frederic Wenzel Cc: Gustafson, Tim; mysql@lists.mysql.com Subject: Re: Problems with select distinct Frederic Wenzel wrote: On Tue, 25

Problems with select distinct

2005-01-25 Thread Gustafson, Tim
Hello I am trying to run the following query on my server: select Documents.ID, Name from Documents, DocumentFiles, DownloadLog where Documents.ID = DocumentFiles.Document and DocumentFiles.ID = DownloadLog.DocumentFile order by DownloadLog.AddedOn desc limit 5

Re: Problems with select distinct

2005-01-25 Thread Michael Stassen
I suspect mysql is doing the DISTINCT before the ORDER BY. One of the reasons I avoid DISTINCT when possible. Try: SELECT Documents.ID, Name FROM Documents, DocumentFiles, DownloadLog WHERE Documents.ID = DocumentFiles.Document AND DocumentFiles.ID = DownloadLog.DocumentFile GROUP

Re: Problems with select distinct

2005-01-25 Thread Frederic Wenzel
On Tue, 25 Jan 2005 08:44:45 -0500, Michael Stassen [EMAIL PROTECTED] wrote: I suspect mysql is doing the DISTINCT before the ORDER BY. One of the reasons I avoid DISTINCT when possible. Isn't this supposed to be correct? Ordering has to take place as the very last operation, after any

Re: Problems with select distinct

2005-01-25 Thread Michael Stassen
Frederic Wenzel wrote: On Tue, 25 Jan 2005 08:44:45 -0500, Michael Stassen [EMAIL PROTECTED] wrote: I suspect mysql is doing the DISTINCT before the ORDER BY. One of the reasons I avoid DISTINCT when possible. Isn't this supposed to be correct? Ordering has to take place as the very last

Problems Using SELECT INTO OUTFILE

2003-03-05 Thread Nick Pasich
support: email support Synopsis: Problems Using SELECT INTO OUTFILE Severity: non-critical Priority: medium Category: mysql Class: sw-bug Release: mysql-4.0.10-gamma (Source distribution) Server: /usr/local/MYSQL/bin/mysqladmin Ver 8.40 Distrib 4.0.10-gamma

Problems Using SELECT INTO OUTFILE

2003-03-05 Thread Nick Pasich
support: email support Synopsis: Problems Using SELECT INTO OUTFILE Severity: non-critical Priority: medium Category: mysql Class: sw-bug Release: mysql-4.0.10-gamma (Source distribution) Server: /usr/local/MYSQL/bin/mysqladmin Ver 8.40 Distrib 4.0.10-gamma

problems with SELECT and related tables

2002-03-07 Thread David Youngblood
I am running Apache/PHP 4/MySQL 3.23 on a Win98. The following statement will not execute in PHP MyAdmin or through the browser. However it does run under my SQL tool SQLion: SELECT contacts.contactId,contacts.firstName,orders.orderId FROM contacts INNER JOIN orders ON contacts.contactId =

Re: Problems with select

2002-02-13 Thread alec . cawley
I have a (probably dumb) question. My table temperatura has two fields described bellow. snip When I try to select rows with floats, the result is an empty set. This is not a MySQL problem, nor a database one, but a general computer science one. It is almost never save to compare two

Re: Problems with select

2002-02-13 Thread admin
Hi. You forgot around temp example: mysqlselect datetime,temperatura from temperatura where datetime=2002-02-08 09:30:00 and temperatura=15.8; Regards /PM\ Miguel Figueiredo wrote: Hello all, I have a (probably dumb) question. My table temperatura has two fields described bellow.

Re: Problems with select

2002-02-12 Thread Gerald Clark
15.8 has no exact binary representation, so a test for equality will fail. Do not use floating point if you want to test for equality. Try DECIMAL Miguel Figueiredo wrote: Hello all, I have a (probably dumb) question. My table temperatura has two fields described bellow. mysql describe

Re: Problems with select

2002-02-12 Thread DL Neil
MySQL manual A.5.7 Problems with floating point comparison =dn - Original Message - From: Gerald Clark [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: 08 February 2002 15:24 Subject: Re: Problems with select 15.8 has no exact binary representation, so a test

Problems with select

2002-02-08 Thread Miguel Figueiredo
Hello all, I have a (probably dumb) question. My table temperatura has two fields described bellow. mysql describe temperatura; +-+--+--+-+-+---+ | Field| Type | Null | Key | Default | Extra |

Re: Problems with select

2002-02-08 Thread admin
Hi. You forgot around temp example: mysqlselect datetime,temperatura from temperatura where datetime=2002-02-08 09:30:00 and temperatura=15.8; Regards /PM\ Miguel Figueiredo wrote: Hello all, I have a (probably dumb) question. My table temperatura has two fields described bellow.

Re: Problems with select

2002-02-08 Thread alec . cawley
I have a (probably dumb) question. My table temperatura has two fields described bellow. snip When I try to select rows with floats, the result is an empty set. This is not a MySQL problem, nor a database one, but a general computer science one. It is almost never save to compare two

Re: Problems with select

2002-02-08 Thread Gerald Clark
15.8 has no exact binary representation, so a test for equality will fail. Do not use floating point if you want to test for equality. Try DECIMAL Miguel Figueiredo wrote: Hello all, I have a (probably dumb) question. My table temperatura has two fields described bellow. mysql describe

RE: HELP NEEDED: Problems with SELECT in combination with HAVING

2001-06-27 Thread Thomas Michael Koch
PROTECTED]] Sent: 26. juni 2001 17:42 To: [EMAIL PROTECTED] Subject: Re: HELP NEEDED: Problems with SELECT in combination with HAVING Try SELECT robotId, max(startTime) as crit FROM RobotRun WHERE startTime = '2001-06-26 00:00:00' AND endTime IS NOT NULL GROUP BY robotId This should return

RE: HELP NEEDED: Problems with SELECT in combination with HAVING 2

2001-06-27 Thread Thomas Michael Koch
:[EMAIL PROTECTED]] Sent: 26. juni 2001 17:42 To: [EMAIL PROTECTED] Subject: Re: HELP NEEDED: Problems with SELECT in combination with HAVING Try SELECT robotId, max(startTime) as crit FROM RobotRun WHERE startTime = '2001-06-26 00:00:00' AND endTime IS NOT NULL GROUP BY robotId This should return

Re: HELP NEEDED: Problems with SELECT in combination with HAVING

2001-06-27 Thread Hannes Niedner
: Re: HELP NEEDED: Problems with SELECT in combination with HAVING Try SELECT robotId, max(startTime) as crit FROM RobotRun WHERE startTime = '2001-06-26 00:00:00' AND endTime IS NOT NULL GROUP BY robotId This should return the robotId and the most recent startTime labeled 'crit

HELP NEEDED: Problems with SELECT in combination with HAVING

2001-06-26 Thread Thomas Michael Koch
Hello there - I have this weird problem using MySql (version 3.23.39). It seems that MySql interpretation of a SELECT statment using HAVING is completely random. I have a table called RobotRun which stores information about when a robot has been running (start, stop and the id of the robot).

Re: HELP NEEDED: Problems with SELECT in combination with HAVING

2001-06-26 Thread Hannes Niedner
Try SELECT robotId, max(startTime) as crit FROM RobotRun WHERE startTime = '2001-06-26 00:00:00' AND endTime IS NOT NULL GROUP BY robotId This should return the robotId and the most recent startTime labeled 'crit' for all records specified in the where clause. And have a look in the manual for