Time zones and grouping

2003-10-14 Thread Graeme B. Davis
Message - From: "Graeme B. Davis" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, October 10, 2003 2:12 PM Subject: Converting GMT stored data into other zones | I was wondering if anyone had any tricks on the best way to handle | localizing time zones in

Re: Converting GMT stored data into other zones

2003-10-13 Thread Graeme B. Davis
27;t know how to work around this... Regards, Graeme | On 10 Oct 2003 at 14:12, Graeme B. Davis wrote: | | > BUT, I've run into a problem when you want to GROUP BY | > DAYOFYEAR(datefield) for example, I want it to do the grouping by EDT | > and not GMT -- is this possible? | | You

Converting GMT stored data into other zones

2003-10-10 Thread Graeme B. Davis
I was wondering if anyone had any tricks on the best way to handle localizing time zones in MySql? For example, all my datetime data is stored as GMT. I have written tools to query the data based upon whatever local time zone you want to use. So, for example if I query for 2003-10-1 to 2003-10-2

Query question "average per hour per agent"

2002-05-17 Thread Graeme B. Davis
I'm having a problem in a query that I'm trying to do. I have a database of tickets and I want to get "the average numbers of tickets created per agent per hour over a date range" in the format: Hour | Avg per agent This is what I have so far: SELECT HOUR(created) AS hourcreated, COUNT(*) AS

formatting currency in mysql

2002-05-06 Thread Graeme B. Davis
Does anyone have a quick tip on how to format a float/numeric in the following currency format with a query? $xx,xxx.xx Thanks! Graeme - Before posting, please check: http://www.mysql.com/manual.php (the manual) http

Re: Average of all NON-NULL columns in a ROW?

2001-05-22 Thread Graeme B. Davis
Evans" <[EMAIL PROTECTED]> To: "Graeme B. Davis" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, May 22, 2001 1:04 PM Subject: Re: Average of all NON-NULL columns in a ROW? > Select avg(id1) from where id1 is not null; ? > > - Original Message

Average of all NON-NULL columns in a ROW?

2001-05-22 Thread Graeme B. Davis
Is there a way to get the AVG of all specified NON-NULL columns in one row? Right now I am doing this in a little script, but it would be nice if I could do something like this: DATA - id1044NULL3NULL I want the average of 0,4,4,3 ie (0+4+4+3)/4 is there a way to

Re: Hierarchy Queries - Multiple LEFT JOINs of the same table?

2001-05-18 Thread Graeme B. Davis
From: "Dibo Chen" <[EMAIL PROTECTED]> To: "Graeme B. Davis" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Friday, May 18, 2001 2:53 PM Subject: Re: Hierarchy Queries - Multiple LEFT JOINs of the same table? > try: > > select s3.name from staff

Hierarchy Queries - Multiple LEFT JOINs of the same table?

2001-05-18 Thread Graeme B. Davis
I have a staff database which contains a column that has a "reports to" field. If I have a table like this: IDNameReports To 1 Graeme 5 3 Bob 6 5 Sue 3 How can I (in one query) find the next 2 levels of people that Graeme reports to? Ie, I

Re: LAST_INSERT_ID returning 3 rows?

2001-05-01 Thread Graeme B. Davis
Ok now I understand -- it's on a per-connection basis =) thanks, graeme - Original Message - From: "Graeme B. Davis" <[EMAIL PROTECTED]> To: "Gerald Clark" <[EMAIL PROTECTED]>; "Braxton Robbason" <[EMAIL PROTECTED]> Cc: <[EMAIL PRO

Re: LAST_INSERT_ID returning 3 rows?

2001-05-01 Thread Graeme B. Davis
one line for each row > of 'outages' > > Leave out the "from outages" > > Graeme B. Davis wrote: > > > mysql> INSERT INTO outages (status) VALUES ('Open'); > > mysql> SELECT LAST_INSERT_ID() AS lid FROM outages; > > +-+ &g

LAST_INSERT_ID returning 3 rows?

2001-04-30 Thread Graeme B. Davis
mysql> INSERT INTO outages (status) VALUES ('Open'); mysql> SELECT LAST_INSERT_ID() AS lid FROM outages; +-+ | lid | +-+ | 101 | | 101 | | 101 | +-+ 3 rows in set (0.00 sec) Why would MYSQL do this? Any ideas? Thanks, Graeme p.s. DESCRIBE outages; +---+---

LEFT JOINing a table you are already SELECTing

2001-02-21 Thread Graeme B. Davis
Is it possible to have the following situation: Schema: id first last optional_id I want to do a select like this: SELECT D.id, D.first, D.last, D.optional_id, db1.first, db1.last FROM db1 AS D LEFT JOIN db1 ON D.optional_id=db1.id; and have it return: |id|first|last|optional_id|first|last|

Re: MySQL GUI for Windows

2001-02-12 Thread Graeme B. Davis
Mascon is sweet, but it's not free :) > can anyone suggest a good GUI client to suggest to MySQL hosting > customers? - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/

GROUPing question

2001-02-02 Thread Graeme B. Davis
I have a GROUPing question on the following query: SELECT HOUR(closedtime) AS hour, COUNT(assignedto) AS count FROM db WHERE (closedtime >='2001-01-01' AND closedtime <= '2001-01-31 23:59:59') AND assignedto='person' GROUP BY hour; give something like this: +--++---+ | hour

mysql compile error on solaris 2.5.1

2001-01-23 Thread Graeme B. Davis
Any ideas on this error? I'd love to use fulltext, but the last server that compiled for me was 3.23.14 :( c++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/var/home/ap psweb/newmysql\"" -DDATADIR="\"/var/home/appsweb/newmysql/ var\"" -DSHARE