Re: Query Problems

2007-07-19 Thread Douglas Araujo
We solved it here, There was a problem in the query, we removed the "t1" at the 'group by' section. The problem was really a sintax error in the code not in the server. Thanks, Douglas 2007/7/19, Michael Dykman <[EMAIL PROTECTED]>: instead of leaving it in PHP, please print out your fully fo

Query Problems

2007-07-18 Thread Douglas Araujo
Hello everydoby, I'm having a problem executing a query in the MySQL server version 4.1, the same query works fine in my other server with MySQL version 4.0. My PHP code is attached, and the query is one on the line 13. Please somebody help me, Thanks, Douglas dbFlashDadosSonabra.php Descr

Re: Query Problems

2004-02-26 Thread Eric Scuccimarra
For anyone who is interested the thing that worked and brought the query down from 8 minutes to 5 seconds was separating out the JOIN to remove the OR. I made it into two queries and UNIONed them together and it all works beautifully now. Thanks. At 02:33 PM 2/25/2004 -0800, Daniel Clark wrote

Re: Query Problems

2004-02-26 Thread Eric Scuccimarra
Have one more question - indexing the relevant columns based on the explain info has made all of our queries immensely faster. But it appears that new rows are not automatically indexed. Does anyone know about this and if they are not indexed how do I reindex the tables? Thanks. -- MySQL Gen

Re: Query Problems

2004-02-26 Thread Keith C. Ivey
On 26 Feb 2004 at 13:22, Eric Scuccimarra wrote: > But it appears that new rows are not automatically indexed. Does > anyone know about this and if they are not indexed how do I reindex > the tables? You're misunderstanding something. When you create an index, all the rows in the table are inde

Re: Query Problems

2004-02-26 Thread Sasha Pachev
Eric Scuccimarra wrote: Have one more question - indexing the relevant columns based on the explain info has made all of our queries immensely faster. But it appears that new rows are not automatically indexed. Does anyone know about this and if they are not indexed how do I reindex the tables?

Re: Query Problems

2004-02-25 Thread Eric Scuccimarra
Tried to make the indexes separate and did an EXPLAIN and no performance increase and this is what the explain says: id select_type table typepossible_keys key key_len ref rowsExtra 1 SIMPLE tb ALL PRIMARY,tb_ndx3,tb_ndx4,tb_ndx5 NULLNU

Re: Query Problems

2004-02-25 Thread Daniel Clark
I know Oracle likes the indexes separatly, but mySQL might like combinations. > No, we tried individual indexes and then one big grouped index but not > individual indexes on each of the fields. Adding the index actually > added a few seconds to the query so we weren't sure if that was the way >

Re: Query Problems

2004-02-25 Thread Eric Scuccimarra
No, we tried individual indexes and then one big grouped index but not individual indexes on each of the fields. Adding the index actually added a few seconds to the query so we weren't sure if that was the way to go. I'll try this, though. Eric At 10:36 AM 2/25/2004 -0800, Daniel Clark wrote:

Re: Query Problems

2004-02-25 Thread Keith C. Ivey
On 25 Feb 2004 at 13:09, Eric Scuccimarra wrote: > Select* > FROM Table1 as a > INNER JOIN Table2 as b ON (a.ID = b.ID or (a.Field1 = b.Field1 and > a.Field2 = b.Field2)) WHERE bla bla bla It's hard to know without seeing the indexes and the full WHERE clause, but part of th

Re: Query Problems

2004-02-25 Thread Daniel Clark
Do you have separate indexes on: Table1.ID Table2.ID Table1.Field1 Table2.Field1 Table1.Field1 Table1.Field2 > Select* > FROM Table1 as a > INNER JOIN Table2 as b ON (a.ID = b.ID or (a.Field1 = b.Field1 and > a.Field2 = b.Field2)) > WHERE bla bla bla > > We ha

RE: Query Problems

2004-02-25 Thread David Perron
What does the explain look like? -Original Message- From: Eric Scuccimarra [mailto:[EMAIL PROTECTED] Sent: Wednesday, February 25, 2004 1:03 PM To: [EMAIL PROTECTED] Subject: Query Problems I am doing a very simple query joining two copies of tables with identical structures but

Query Problems

2004-02-25 Thread Eric Scuccimarra
I am doing a very simple query joining two copies of tables with identical structures but different data. We are running MySQL 4.1.1. The tables each have about 24,000 lines of data in them. For some reason this query, which is a simple join between the two tables is taking 8 minutes to run. T

Query Problems

2004-02-25 Thread Eric Scuccimarra
I am doing a very simple query joining two copies of tables with identical structures but different data. We are running MySQL 4.1.1. The tables each have about 24,000 lines of data in them. For some reason this query, which is a simple join between the two tables is taking 8 minutes to run. T

RE: Error: "unable to execute query" - Problems using Win32 MySQL ODBC driver

2003-10-09 Thread Fortuno, Adam
Pako, That blows my theory. Regards, Adam -Original Message- From: Pakó Géza [mailto:[EMAIL PROTECTED] Sent: Thursday, October 09, 2003 2:32 PM To: Fortuno, Adam Subject: Re: Error: "unable to execute query" - Problems using Win32 MySQL ODBC driver i dont use odbc. i

RE: Error: "unable to execute query" - Problems using Win32 MySQL ODBC driver

2003-10-09 Thread Fortuno, Adam
Hmm, that is weird. Actually, I had the same issue (sort of). I was grabbing some data from a MySQL instance on an OS X workstation. I had shared the tables in Access via ODBC. I'd start to update the MySQL DB and get an ODBC error. Usually I'd get about 93 rows done (out of 1000 or so). You're ge

RE: MySQL query problems

2003-07-16 Thread C. Reeve
. -Original Message- From: Jef S [mailto:[EMAIL PROTECTED] Sent: July 16, 2003 12:50 PM To: [EMAIL PROTECTED] Subject: RE: MySQL query problems Have you checked the query in an editor to see if they are working? Just substitute known values in the place of the variables you are using

RE: MySQL query problems

2003-07-16 Thread Jef S
D] > Subject: MySQL query problems > > > Hi, > > Not sure if the problem here is PHP or MySQL, but here we go. I am > trying to do two queries on a database - one after the other, but the > second one never seems to get executed. The two queries are identical > except fo

MySQL query problems

2003-07-16 Thread C. Reeve
Hi, Not sure if the problem here is PHP or MySQL, but here we go. I am trying to do two queries on a database - one after the other, but the second one never seems to get executed. The two queries are identical except for two variables. I have checked my form and they are correct and are being se

RE: [PHP-DB] time field query problems.

2002-07-30 Thread Steve Bradwell
: Re: [PHP-DB] time field query problems. Steve, > For some reason the below statement is not working. Can anyone tell me why? > > Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL 10 MINUTE < now() > AND ORDER_NO = '5' AND EDIT_LOCK > 0; > > -EDIT_

Re: [PHP-DB] time field query problems.

2002-07-29 Thread DL Neil
Steve, > For some reason the below statement is not working. Can anyone tell me why? > > Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL 10 MINUTE < now() > AND ORDER_NO = '5' AND EDIT_LOCK > 0; > > -EDIT_LOCK is a MySQL (ver 3.23.49-max) time field, allows nulls, default is > NULL. >

Re: time field query problems.

2002-07-29 Thread Benjamin Pflugmann
Hi. On Mon 2002-07-29 at 14:41:30 -0400, [EMAIL PROTECTED] wrote: > Sorry to repost but I typed in the wrong sql statement in my previous post. Ah. Okay. > For some reason the below statement is not working. Can anyone tell me why? > > Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL

time field query problems.

2002-07-29 Thread Steve Bradwell
Sorry to repost but I typed in the wrong sql statement in my previous post. For some reason the below statement is not working. Can anyone tell me why? Select EDIT_LOCK from ordmaster where EDIT_LOCK + INTERVAL 10 MINUTE < now() AND ORDER_NO = '5' AND EDIT_LOCK > 0; -EDIT_LOCK is a MySQL (ver 3

Re: NOT IN query problems.

2001-09-07 Thread Paul DuBois
At 4:40 PM -0700 9/7/01, Anthony E. wrote: >I've tried to do a NOT IN statement, but still am >getting SQL syntax error. > > >SELECT COUNT(*) FROM USER_TMP WHERE USER_TMP.email NOT >IN (SELECT USER.email FROM USER); > >I'm trying to produce a list of records from USER_TMP Huh? COUNT(*) produces

NOT IN query problems.

2001-09-07 Thread Anthony E.
I've tried to do a NOT IN statement, but still am getting SQL syntax error. SELECT COUNT(*) FROM USER_TMP WHERE USER_TMP.email NOT IN (SELECT USER.email FROM USER); I'm trying to produce a list of records from USER_TMP table where the USER_TMP.email is NOT IN USER.email. (in other words, i wan

Re: Q: SQL query problems

2001-05-22 Thread Bob Hall
>Hello, > >I have a problem composing a sql-statement for my special needs. >I hope anybody can help me. > > >This is the situation: > >I have 2 tables, a and b as following: > >-- >| a | >-- >| eid | name | >-- > > >-- >| b

Re: Q: SQL query problems

2001-05-22 Thread Wemmer Alexander
Hi! Paul van den Berg wrote: > > > > > This is the situation: > > > > I have 2 tables, a and b as following: > > > > -- > > | a | > > -- > > | eid | name | > > -- > > > > > > -- > > | b| > > -- > > | id |

Re: Q: SQL query problems

2001-05-22 Thread Paul van den Berg
> > This is the situation: > > I have 2 tables, a and b as following: > > -- > | a | > -- > | eid | name | > -- > > > -- > | b| > -- > | id | gid | eid | > -- > > *) a.eid and b.id are

Q: SQL query problems

2001-05-22 Thread Wemmer Alexander
Hello, I have a problem composing a sql-statement for my special needs. I hope anybody can help me. This is the situation: I have 2 tables, a and b as following: -- | a | -- | eid | name | -- -- | b|

Re: Query problems

2001-04-23 Thread Gerald Clark
Use merge tables, or two separate queries. "Wix,Christian XCW" wrote: > > Hi > I have two similar tables. (table1 & table2). They contain the columns > "name", "distance" and "date". Table1 is year 2000 and Table2 year 2001. > > I need to get the total distance for each name. > For year 2000 I

RE: Query problems

2001-04-23 Thread Warren van der Merwe
; From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > ]On Behalf > Of Wix,Christian XCW > Sent: 23 April 2001 02:02 > To: '[EMAIL PROTECTED]' > Subject: Query problems > > > Hi > I have two similar tables. (table1 & table2). They contain the columns &g

Re: Query problems

2001-04-23 Thread meyer
Create a merge table of the year 2000 and year 2001 tables as follows. Then run your select on the merged table. You can then drop the merge table if you don't need it anymore. CREATE TABLE table3 (name, distance, date) TYPE=MERGE UNION=(table1,table2); SELECT name, SUM(distance) FROM table3 GR

Query problems

2001-04-23 Thread Wix,Christian XCW
Hi I have two similar tables. (table1 & table2). They contain the columns "name", "distance" and "date". Table1 is year 2000 and Table2 year 2001. I need to get the total distance for each name. For year 2000 I would do this: select name, SUM(distance) from table1 group by name; How do I do it f

RE: MySQL 3.23.33 Query Problems

2001-03-05 Thread Bob Hall
>I think I figured the problem out, but I still do not understand >what happened, the following is showing how I got the query to >work. I basically had to re-import suppliersiclink table to get this >to work right in MySQL 3.23.33, but why? The data was fine in >MySQL 3.22. > >mysql> select * f

RE: MySQL 3.23.33 Query Problems

2001-03-05 Thread Johnny Withers
I think I figured the problem out, but I still do not understand what happened, the following is showing how I got the query to work. I basically had to re-import suppliersiclink table to get this to work right in MySQL 3.23.33, but why? The data was fine in MySQL 3.22. mysql> select * from sup

MySQL 3.23.33 Query Problems

2001-03-05 Thread Johnny Withers
Lets see if anyone can help me out: I have these 3 tables in a MySQL 3.22.27 Database and i'm running this query: SELECT supplier.id,supplier.company_name,supplier.contact_name,supplier.address_street, supplier.address_city,supplier.address_state,supplier.address_zip,supplier.phone_business, supp

RE: Complex Query Problems

2001-02-27 Thread Quentin Bennett
y, 28 February 2001 2:45 p.m. To: [EMAIL PROTECTED] Subject: Complex Query Problems I've got a complex query... I was wondering if someone could give me some advice.. Is there any way that I can base the WHERE clause of a query on the contents of another table?? for instance... SELECT name FR

Complex Query Problems

2001-02-27 Thread John Coggeshall
I've got a complex query... I was wondering if someone could give me some advice.. Is there any way that I can base the WHERE clause of a query on the contents of another table?? for instance... SELECT name FROM mytable WHERE(ID=myothertable.idlistcolumn); where myothertable is a HEAP construc