Re: zip code search within x miles

2005-04-25 Thread Richard Lynch
On Tue, April 19, 2005 11:55 am, Hank said: Except that the zip code field is not (and should not be) numeric, so the qualification test fails. *IF* your zip codes are all US zip 5-digit, and *IF* performance is really crucial, and *IF* you are 100% certain you'll never need non-US nor zip+4,

Re: zip code search within x miles

2005-04-25 Thread Richard Lynch
On Tue, April 19, 2005 8:55 am, Hank said: Talk about over complicating things... here's the above query simplifed. I can not figure out why they were self joining the table three times: SELECT b.zip_code, b.state, (3956 * (2 * ASIN(SQRT(

Re: zip code search within x miles

2005-04-25 Thread Richard Lynch
On Mon, April 18, 2005 9:16 pm, Hank said: Let's say you've got, oh, 2000 records to search through. You're gonna end up doing a JOIN with: 2,000 X 65,000 == 130,000,000 tuples (records/results). 130 MILLION tuples is *way* too many for your basic $20/month site. I'd say take some easy

Re: User Variables

2005-04-25 Thread Ed Reed
Does anyone else have any ideas about this topic? Thanks Ed Reed [EMAIL PROTECTED] 04/23/05 1:29 pm Thanks for the reply, I realize that user variables disappear when the connection closes but I don't understand why what I'm trying to accomplish can't be done. Doesn't it make since that if

RE: Replication - is there a server lag?

2005-04-25 Thread mathias fatene
Loo at : mysql show master status; +---+--+--+--+ | File | Position | Binlog_Do_DB | Binlog_Ignore_DB | +---+--+--+--+ | binlog.03 | 79 | | |

libCstd.so.1 not found while running mysql_install_db

2005-04-25 Thread Anirban Karmakar
Hi, I installed mysql-standard-4.0.24-sun-solaris2.8-sparc on a Solaris 5.8 macine. However while i'm running the mysql_install_db script i'm getting the error ld.so.1: ./bin/mysqld: fatal: libCstd.so.1: open failed: No such file or directory Killed Installation of grant tables failed! I've my

RE: joining six tables by mutual column

2005-04-25 Thread mathias fatene
Hi, Select * from table1 T1, table2 T2, table3 T3, table4 T4, table5 T5, table6 T6 Where T1.col=T2.col and T2.col=T3.col and T3.col=T4.col and T4.col=T5.col and T5.col=T6.col and T1.col=T6.col [and col='val'] Doesn't this work ? Have you an example ? Best Regards

RE: zip code search within x miles

2005-04-25 Thread gunmuse
Http://www.gunmuse.com Ok I use a storelocator. First if you have 8000 + records it becomes an issue. BUT Lat and long is in minutes and minutes can be used to estimate miles. By Breaking down the lat and long, Breaking down the Zip to a two digit prefix 88254 becomes 88 for indexing

Ordering rows whit a select from where in ( exp )

2005-04-25 Thread Adrian
Hi everyone, Here is my issue: I have this Query : SELECT field_name FROM meta WHERE id IN ('13','11','7','8','9','10','12') I want the rows to be display in the same order as the in list of ids.Any ideas? Should I use order by? Whit witch

Re: Ordering rows whit a select from where in ( exp )

2005-04-25 Thread =?ISO-8859-1?Q?Johan_H=F6=F6k?=
Hi Adrian, you can do SELECT field_name FROM meta WHERE id IN ('13','11','7','8','9','10','12') ORDER BY FIELD(id,'13','11','7','8','9','10','12') /Johan Adrian wrote: Hi everyone, Here is my issue: I have this Query : SELECT field_name FROM meta WHERE id

RE: libCstd.so.1 not found while running mysql_install_db

2005-04-25 Thread mathias fatene
Do you have /cnem/server/bin/mysqld file ? Is it exec (6xx)? Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer -Original Message- From: Anirban Karmakar [mailto:[EMAIL PROTECTED] Sent: lundi 25 avril 2005 09:12 To:

RE: libCstd.so.1 not found while running mysql_install_db

2005-04-25 Thread mathias fatene
Read 7xx Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer -Original Message- From: mathias fatene [mailto:[EMAIL PROTECTED] Sent: lundi 25 avril 2005 10:18 To: 'Anirban Karmakar'; 'mysql@lists.mysql.com' Subject: RE:

RE: Ordering rows whit a select from where in ( exp )

2005-04-25 Thread mathias fatene
Do that , SELECT field_name FROM meta WHERE id ='13' Union SELECT field_name FROM meta WHERE id ='11' Union SELECT field_name FROM meta WHERE id ='7' Union SELECT field_name FROM meta WHERE id ='8' Union SELECT field_name FROM meta WHERE id ='9' Union SELECT field_name FROM meta WHERE id

Re: Using InnoDB on 2 OSes

2005-04-25 Thread Gleb Paharenko
Hello. I don't know if it is a good idea, but at least check that you have the same version of MySQL on Linux. On Windows, lower_case_table_names is set to 1 by default. See: http://dev.mysql.com/doc/mysql/en/moving.html Marcin Lewandowski [EMAIL PROTECTED] wrote: Hi, I've got

Re: mysql_fix_privilege_tables error

2005-04-25 Thread Gleb Paharenko
Hello. Make a bug or feature report at http://bugs.mysql.com. Josh Trutwin [EMAIL PROTECTED] wrote: Would it be possible to add: ENGINE=MyISAM To all the CREATE TABLE statements in the mysql_fix_privilege_tables script? The server (tested with 5.0.3 and 5.0.4) crashes when

Re: Need help adding database to multi server mysql?

2005-04-25 Thread Gleb Paharenko
Hello. Have you ran mysql_init_db on a new data directory? store the tables that store grants and such, but how to we get those created for the new instance. We've been all over the MySQL.com docs It is unclear for me. You may specify the datadir for every new instance. See:

RE: Write to a mysql table from Excel

2005-04-25 Thread Jay Blanchard
[snip] Don't be so hasty to criticise. I took the original question to mean While I have an existing spreadsheet open in EXCEL, can I cause a selected row in a MySQL table to be updated?. This is quite a different question than How can I convert one sheet from an EXCEL file into a new MySQL

Re: problem with update statement

2005-04-25 Thread Brent Baisley
That is very odd behavior and shouldn't be happening. I ran a quick test on my machine and MySQL does not exhibit that behavior. You may try running and repair on your table. Perhaps something is out of whack. What version of MySQL are you running? On Apr 22, 2005, at 6:08 PM, [EMAIL

Re: problem with update statement

2005-04-25 Thread mfatene
Hi, this is an example where what you describe doesn't happen (v 4.1 and 5.0) : mysql create table ports(mac varchar(17),port_index varchar(3)); Query OK, 0 rows affected (0.10 sec) mysql insert into ports values('00:04:FB:23:5A:44','120'),(NULL,'120'); Query OK, 2 rows affected (0.08 sec)

Re: problem with update statement

2005-04-25 Thread ragan_davis
Thanks for the info. I am using 4.0.24, so maybe this is the problem. I was able to get around this by first checking if the mac field was empty, but I will look into upgrading mysql to a more current version. thanks - Original Message - From: [EMAIL PROTECTED] Date: Monday, April 25,

Re: User Variables

2005-04-25 Thread SGreen
Ed Reed [EMAIL PROTECTED] wrote on 04/25/2005 02:33:23 AM: Does anyone else have any ideas about this topic? Thanks Ed Reed [EMAIL PROTECTED] 04/23/05 1:29 pm Thanks for the reply, I realize that user variables disappear when the connection closes but I don't understand why what

RE: MYSQL to XML

2005-04-25 Thread Mikel -
Thanx Mathias for your quick and effective response, I see that your program almost display the format that I need, the thing is that I need the foreign key information too, Does MySQL have a statement besides show create table to display this information?Thanks again for your suggestions

Re: joining six tables by mutual column

2005-04-25 Thread Nick Pasich
Try this If something is numeric SELECT * FROM table1, table2, table3, table4, table5, table6 WHERE table1.something = table2.something AND table1.something = table3.something AND table1.something = table4.something AND table1.something = table5.something

question about chunking sql uploads

2005-04-25 Thread Art.M (Wikki)
Hello, I have a large .sql file to upload which is about 9 mb and I was wondering if anyone knew of a program that could break it up into chunks of 2 mb or under? So I can upload it to a shared web server. Thanks ahead for your response. Wikki -- MySQL General Mailing List For list archives:

Re: mysql_fix_privilege_tables error

2005-04-25 Thread Josh Trutwin
On Fri, 22 Apr 2005 22:44:44 +0300 Gleb Paharenko [EMAIL PROTECTED] wrote: Hello. Make a bug or feature report at http://bugs.mysql.com. Already did - 10098 - it was recently closed, guess it was already fixed in 5.0.5. Josh -- MySQL General Mailing List For list archives:

MySQL Client Hangs on QNX

2005-04-25 Thread Stephen Rasku
I am using MySQL 4.0.17 on QNX 6.2.1b. I have noticed this in the last couple of days. There were two MySQL clients running: one since 1:30 that morning; one at 1:30 the previous morning. These are reset master commands we issue from cron to clean up the transaction logs. This morning I tried

Message repeating every second in Error Log

2005-04-25 Thread TheRefUmp
Does anyone know why this message keeps repeating: 050425 11:31:40 229 Query SHOW STATUS 229 Query SHOW INNODB STATUS 050425 11:31:41 229 Query SHOW STATUS 229 Query SHOW INNODB STATUS 050425 11:31:42 229 Query SHOW

Re: Message repeating every second in Error Log

2005-04-25 Thread mfatene
Hi, do you continue to have it even if you EXIT your Mysql Administrator ? Mathias Selon [EMAIL PROTECTED]: Does anyone know why this message keeps repeating: 050425 11:31:40 229 Query SHOW STATUS 229 Query SHOW INNODB STATUS 050425 11:31:41 229 Query

RE: MYSQL to XML

2005-04-25 Thread mfatene
Hi Mikel, Show create table shows a line CONSTRAINT ... FORIEGN KEY ... you can add a grep on this line. But this will be difficult. You can construct another desc2xml using just show create table to have it easier. Mathias Selon Mikel - [EMAIL PROTECTED]: Thanx Mathias for your quick and

Re: question about chunking sql uploads

2005-04-25 Thread Frank Bax
At 10:44 AM 4/25/05, Art.M (Wikki) wrote: I have a large .sql file to upload which is about 9 mb and I was wondering if anyone knew of a program that could break it up into chunks of 2 mb or under? So I can upload it to a shared web server. You can't upload a 9M file to webserver? But you can

Re: question about chunking sql uploads

2005-04-25 Thread SGreen
Frank Bax [EMAIL PROTECTED] wrote on 04/25/2005 11:47:12 AM: At 10:44 AM 4/25/05, Art.M (Wikki) wrote: I have a large .sql file to upload which is about 9 mb and I was wondering if anyone knew of a program that could break it up into chunks of 2 mb or under? So I can upload it to a shared web

Converting to InnoDB?

2005-04-25 Thread Carl Riches
We are running MySQL on Red Hat Enterprise Linux 3, using the Red Hat- supplied RPM file mysql-server-3.23.58-2.3. Our current MySQL configuration has MyISAM as the default database file type. I would like to change this such that InnoDB is the default. My understanding of the documentation

RE: Converting to InnoDB?

2005-04-25 Thread mathias fatene
Yes, but your myIsam Tables stay myisam ones. After restarting, you must change them to innodb by : Alter table toto storage=innodb. For new tables, they will have innodb storage. Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer

RE: Converting to InnoDB?

2005-04-25 Thread mathias fatene
Sorry, Alter table toto ENGINE=innodb. You don't must, you can. You can also have differents storage ENGINES in the same mysql database. With innodb, you will earn ROW level locking. Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer

RE: Converting to InnoDB?

2005-04-25 Thread Carl Riches
On Mon, 25 Apr 2005, mathias fatene wrote: Sorry, Alter table toto ENGINE=innodb. You don't must, you can. You can also have differents storage ENGINES in the same mysql database. With innodb, you will earn ROW level locking. Best Regards Mathias FATENE Thanks, Mathias! Carl

Re: question about chunking sql uploads

2005-04-25 Thread Scott Gifford
[EMAIL PROTECTED] writes: Frank Bax [EMAIL PROTECTED] wrote on 04/25/2005 11:47:12 AM: At 10:44 AM 4/25/05, Art.M (Wikki) wrote: I have a large .sql file to upload which is about 9 mb and I was wondering if anyone knew of a program that could break it up into chunks of 2 mb or under? So I

Re: question about chunking sql uploads

2005-04-25 Thread Frank Bax
At 02:07 PM 4/25/05, Scott Gifford wrote: [EMAIL PROTECTED] writes: Frank Bax [EMAIL PROTECTED] wrote on 04/25/2005 11:47:12 AM: Or simply use split, default is 1000 lines, but can be changed via command line. That's a start, but the files each need to be a valid SQL statement, so that's not

Re: question about chunking sql uploads

2005-04-25 Thread SGreen
Frank Bax [EMAIL PROTECTED] wrote on 04/25/2005 02:27:58 PM: At 02:07 PM 4/25/05, Scott Gifford wrote: [EMAIL PROTECTED] writes: Frank Bax [EMAIL PROTECTED] wrote on 04/25/2005 11:47:12 AM: Or simply use split, default is 1000 lines, but can be changed via command line. That's

Query question

2005-04-25 Thread Jeff McKeon
I have a table that contains records that link back to a main talbe in a many to one configuration linked by table1.id = table2.parentid Table1 (one) Table2 (many) I want to pull the latest records from table2 for each record in table1 where certain criteria applie. So, if record 100 in table1

Re: Query question

2005-04-25 Thread SGreen
Jeff McKeon [EMAIL PROTECTED] wrote on 04/25/2005 03:00:55 PM: I have a table that contains records that link back to a main talbe in a many to one configuration linked by table1.id = table2.parentid Table1 (one) Table2 (many) I want to pull the latest records from table2 for each record

RE: Query question

2005-04-25 Thread mathias fatene
Hi, You can do something like that : mysql select * from son; +--+ | a| +--+ |1 | |2 | |3 | +--+ 3 rows in set (0.02 sec) mysql select * from mother; +--+--+ | a| b| +--+--+ |1 | a| |1 | b| |2 | a| |2 | c| |3

RE: Query question

2005-04-25 Thread SGreen
mathias fatene [EMAIL PROTECTED] wrote on 04/25/2005 03:19:33 PM: Hi, You can do something like that : mysql select * from son; +--+ | a| +--+ |1 | |2 | |3 | +--+ 3 rows in set (0.02 sec) mysql select * from mother; +--+--+ | a| b|

Re: Query question

2005-04-25 Thread Peter Brawley
Jeff, Something like ... SELECT * FROM table2 AS a WHERE datestamp = ( SELECT MAX( b.datestamp ) FROM table2 AS b WHERE a.parentID = b.parentID ); PB - Jeff McKeon wrote: I have a table that contains records that link back to a main talbe in a many to one configuration linked by table1.id =

RE: Query question

2005-04-25 Thread mathias fatene
Hi, Why my answer doesn't answer his question. Did you heared about his comment. Let him do it. If you're confused, i can explain more one-to-many relashionships. If you think about joins and want absolutely add them, this is the error generating performance problems asked along all RDMBS,

RE: Query question

2005-04-25 Thread Jeff McKeon
Thanks all but I don't have a mysql version high enough for subqueries. Thanks, Jeff -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 4:01 PM To: Jeff McKeon Cc: mysql@lists.mysql.com Subject: Re: Query question Jeff, Something

RE: Query question

2005-04-25 Thread mathias fatene
Here we are Shawn, With empty tables : +++---+--+---+--+--- --+--+--+-+ | id | select_type| table | type | possible_keys | key | key_len | ref | rows | Extra |

Re: Query question

2005-04-25 Thread Peter Brawley
Jeff, Then do it with 2 queries, SELECT @d := MAX( datestamp ) FROM table2 WHERE parentID = X; SELECT * FROM table2 WHERE parentID = X AND [EMAIL PROTECTED]; PB - Jeff McKeon wrote: Thanks all but I don't have a mysql version high enough for subqueries. Thanks, Jeff

Re: Query question

2005-04-25 Thread Peter Brawley
Jeff, Then do it with 2 queries, SELECT @d := MAX( datestamp ) FROM table2 WHERE parentID = X; SELECT * FROM table2 WHERE parentID = X AND [EMAIL PROTECTED]; PB - Jeff McKeon wrote: Thanks all but I don't have a mysql version high enough for subqueries. Thanks, Jeff

RE: Query question

2005-04-25 Thread mathias fatene
Hi, Im sorry to disappoint you but this is an anti-performance solution. Use joins rathers than subqueries, and don't use joins if you can (all data in the mother table). Imagine that table2 has 30.000.000 records, and not good indexes. you can wait for your answer a long time. Best Regards

RE: Query question

2005-04-25 Thread Jeff McKeon
Peter, I'm unfamiliar with the @d := section you describe. Is this psudo code or real syntax? thanks, Jeff -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 4:17 PM To: Jeff McKeon Cc:

Re: Query question

2005-04-25 Thread Peter Brawley
Title: Message Mathias, Im sorry todisappoint you but this is an anti-performance solution. Use joins rathers than subqueries, and don't use joins if you can (all data in the mother table). This 2-query solution uses neither a join nor a subquery. What do you mean? PB - mathias

RE: Query question

2005-04-25 Thread SGreen
Jeff McKeon [EMAIL PROTECTED] wrote on 04/25/2005 04:08:29 PM: Thanks all but I don't have a mysql version high enough for subqueries. Thanks, Jeff -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 4:01 PM To: Jeff McKeon Cc:

Re: Query question

2005-04-25 Thread Peter Brawley
Title: Message That's real syntax for inline assignment of a column value to a user variable. What MySQL version are you using? PB Jeff McKeon wrote: Peter, I'm unfamiliar with the "@d := " section you describe. Is this psudo code or real syntax? thanks, Jeff

RE: Query question

2005-04-25 Thread Jeff McKeon
3.23. no control over this right now or i'd upgrade, believe me! jeff -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: Monday, April 25, 2005 4:43 PM To: Jeff McKeon Cc: mysql@lists.mysql.com Subject: Re: Query

Re: Query question

2005-04-25 Thread Peter Brawley
Title: Message Jeff, 3.23. no control over this right now or i'd upgrade, believe me! Yep, I maintain websites with the same problem. Shawn Green just posted a solution that doesn't need inline user variable assignment. PB - Jeff McKeon wrote: 3.23. no control over

RE: Query question

2005-04-25 Thread SGreen
mathias fatene [EMAIL PROTECTED] wrote on 04/25/2005 04:24:42 PM: Hi, Im sorry to disappoint you but this is an anti-performance solution. Use joins rathers than subqueries, and don't use joins if you can (all data in the mother table). Imagine that table2 has 30.000.000 records, and not

RE: Query question

2005-04-25 Thread Jeff McKeon
thanks, I'll give that a try tomorrow. :o) Jeffrey S. McKeon Manager of Information Technology Telaurus Communications LLC [EMAIL PROTECTED] +1 (973) 889-8990 ex 209 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, April

RE: Query question

2005-04-25 Thread mathias fatene
Hi, If my englsih is so bad, i'll try to explain and stop this thread now. I'm not teaching, i'm answering questions. If someone wants to read docs, he (she) doesn't ask a question on the list. So if i answer, i answer the question, just the question. You want to know my level of knowledgne, 10

database migration puzzle.

2005-04-25 Thread Kenneth Wagner
Hi all, I have removed mysql 4_0_20d and installed 4.1. My puzzle is this: 1. I have prior databases in 4.0 (intact data directory with InnoDB files *.idb, etc.) data directory with sub directories. 2. I want to bring in some of the databases to the new 4.1 version. The 4.0 databases

RE: database migration puzzle.

2005-04-25 Thread mathias fatene
Hi, I hope that this link will help http://dev.mysql.com/doc/mysql/en/upgrading-from-4-0.html Best Regards Mathias FATENE Hope that helps *This not an official mysql support answer -Original Message- From: Kenneth Wagner [mailto:[EMAIL PROTECTED] Sent: mardi 26

Crosstab in Mysql

2005-04-25 Thread Alvaro Cobo
Hi guys: I am quite new in SQL and I need to build a crosstab based in two tables using Mysql and PHP, but it is becoming quite dificult. I've got the next query, but it keeps giving the next error: #1241 - Operand should contain 1 column(s) /*GENERAL EXPLANATION OF THE QUERY I work in a

RE: Crosstab in Mysql

2005-04-25 Thread mathias fatene
Hi, What do you obtain with : Select FK_partic, Sum(IF(insumo_or = Animal1, cantidad_or, 0) ) AS Animal1, Sum(IF (insumo_or = Animal2, cantidad_or, 0) ) AS Animal2, Sum(IF (insumo_or = Animal3, cantidad_or, 0) ) AS Animal3, Sum(IF (insumo_or = Animal4, cantidad_or, 0) ) AS Animal4, Sum(IF

Index help ?

2005-04-25 Thread Michael Gale
Hello, I have the following table setup: IDhostnamefacilityprioritydatemessage ID is auto incrementing. This is used to store all of the syslog messages, currently there are over 7 million: The following query takes forever: Select machine,count(*) from syslog WHERE

Re: Crosstab in Mysql

2005-04-25 Thread Peter Brawley
Alvaro, I suspect the error message refers to the subquery missing a non-aggregate column on which to GROUP BY. I may misunderstand your query--I'm not clear why you can't just write ... SELECT f.PK_partic, f.FK_IS, f.OB_familia, Sum( IF( insumo_or = "Animal1", cantidad_or, 0 )) AS

RE: Index help ?

2005-04-25 Thread mathias fatene
I think the second can be better (more different values). But it contains almost the same data than the table. Try : explain Select machine,count(*) from syslog WHERE date1 (NOW() - INTERVAL 24 hour) AND message LIKE 'sshd%' GROUP BY machine; But an index with(date1, message, machine)

Re: Python related MySQL question

2005-04-25 Thread Smelly Socks
Hi! I am porting a function library app I wrote in PHP to Python. At work they only use Python. I've researched how to connect to a MySql database using Python, and how to retrieve rows. However, I am wondering how to do the following: I can do this in Python = $da=MYSQL_QUERY(select * from

Re: Crosstab in Mysql

2005-04-25 Thread Alvaro Cobo
You guys are the best!!!. I have spent hours trying to solve this problema and Peter´s answer was the solution. I´ll write a post with the whole explanation of the problem. Thanks and best regards, Alvaro. PD: Mathias, I´ll send the tables with data and the solution. Thanks!. -