Re: Strange query.

2007-01-11 Thread Felix Geerinckx
[EMAIL PROTECTED] ("Paul Halliday") wrote in news:[EMAIL PROTECTED]: > Could you expand a little on how that works? USE test; DROP TABLE IF EXISTS event; CREATE TABLE event (timestamp DATETIME NOT NULL); INSERT INTO event (timestamp) VALUES ('2007-01-09 20:02:15'), ('2007-01-09 20:02:15'), ('200

Re: Strange query.

2007-01-11 Thread Paul Halliday
Could you expand a little on how that works? I am starting to think that I wont be able to get the results I need without post processing. Looking at the results: ... | 2007-01-09 20:02:15 | | 2007-01-09 20:02:15 | | 2007-01-09 20:03:20 | | 2007-01-09 20:08:33 | | 2007-01-09 20:08:33 | | 2007-01

Re: Strange query.

2007-01-10 Thread Felix Geerinckx
[EMAIL PROTECTED] ("Paul Halliday") wrote in news:[EMAIL PROTECTED]: > I am trying to deal with empty values so that I can graph data over a > 24 hour period without gaps. Have a look here: http://forums.mysql.com/read.php?10,133603,133607#msg-133607 -- felix -- MySQL General Mailing List

Re: Strange query.

2007-01-10 Thread ddevaudreuil
To "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> cc Subject Re: Strange query. e.c1? Giving me errors.. On 1/10/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Try something like this: > > SELECT > SUM(CASE when e.c1 is null then 0 else 1 end) as counts, HOURS

Re: Strange query.

2007-01-10 Thread ddevaudreuil
01-11 04:00:00' AND sid=1 group by HOURS.hour Donna "Paul Halliday" <[EMAIL PROTECTED]> 01/10/2007 09:48 AM To "Brent Baisley" <[EMAIL PROTECTED]> cc mysql@lists.mysql.com Subject Re: Strange query. That query doesn't return empty values. Ju

Re: Strange query.

2007-01-10 Thread Dan Buettner
Ugh. My perl isn't quite right there. Here's a bit better (e.g. working) example: If you create the table, then put this in "populate_hours.pl": BEGIN #!/usr/bin/perl $counter = 0; while ($counter < 100) { print "INSERT INTO all_hours (date_hour) VALUES ( DATE_ADD('2000-01-01 00:00:00'

Re: Strange query.

2007-01-10 Thread Dan Buettner
One of the most puzzling and challenging things to do with SQL can be to show what's NOT there, as you're trying to do. Many people opt to do such a report in their favorite scripting language for this reason, as one can easily increment timestamps by a given amount and re-do the query. Can be r

Re: Strange query.

2007-01-10 Thread Paul Halliday
That query doesn't return empty values. Just to clarify what I want as the result: My initial query was this, mysql> select count(*),DATE_FORMAT(timestamp,'%H') AS hour FROM event WHERE timestamp between '2007-01-10 04:00:00' and '2007-01-11 04:00:00' AND sid=1 GROUP BY hour; +--+--+

Re: Strange query.

2007-01-10 Thread Brent Baisley
You can't join on the result of calculations in the field selection. The result is not associated with any table. So the problem isn't so much with the date_format statement, but that you are joining on HOURS.hour the timestamp, not HOURS.hour the DATE_FORMAT. I would think you would be getting a

RE: strange query result

2004-06-18 Thread Victor Pendleton
Your explain plan should not change based on the client you are using. The explain plan is the path for the query not the return of data to the client. Are you using sockets when connecting locally on the Free-BSD machine? Sockets are normally faster than using the tcp/ip port. -Original Messa

Re: Strange query behavior

2004-02-13 Thread gerald_clark
Linus Nikander wrote: Whilst trying to figure out why one of my queries wasn't working I ran into the following phenomenon which I'd be grateful if someone could explain. (I'm running mySQL 4.0.17 on a win2003 server, querying using the 0.9.4 mysql control center) The following query returns the

Re: Strange Query

2003-03-26 Thread Bruce Feist
GERST, MICHAEL (SBCSI) wrote: Don't know if this has already come through to everyone, if so I apologize. Ok, here's the deal Table1 is a master list holding ID numbers, and related information sent by clients Table2 is a queue that utilizes Table1.ID numbers, and updates other information on th

Re: Strange Query Results

2002-08-14 Thread Keith C. Ivey
On 14 Aug 2002, at 13:31, Sean C. Burbidge wrote: > The query is: select t.lu_cn as cn, > sum(if(strcmp(t.work_item_type, 'OPERATIONS'), > t.reference_dollars_labor + > t.reference_dollars_equip + > t.reference_dollars_travel + > t.reference_dollars_matl + >

RE: Strange query issues

2002-03-25 Thread Salada, Duncan
Are the first three machines closing their connections correctly? Duncan -- Duncan Salada | Titan | www.titan.com/testeval Email: [EMAIL PROTECTED] | Voice: 301-925-3222x375 | Fax: 301-925-3216 > -Original Message- > From: Gabriel [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 25, 2002