Conditional copy of values

2006-09-21 Thread Ravi Kumar.
Dear All, I have 2 tables Table1 and Table2. In Table1 rowid is primary key and in Table2 rowid is primary key as well as foreign key (referring to rowid in Table1). There are several other columns in Table1, but Table2 has only one col - rowid. I want to insert rowid into Table2

pkgadd error

2006-09-21 Thread zehra cagnan
Hi all, I am trying to install mysql-standard-5.0.24. My OS is Sun Solaris 9. I down loaded the binary package mysql-standard-5.0.24-solaris9-sparc.pkg.gz from your web site. I can unzip the file with no problem using gunzip. The file is at /var/spool/pkg. While in this directory I am typing the

Re: multicolumn indexes, yes or no

2006-09-21 Thread Surendra Singhi
Hi Dan, Dan Buettner [EMAIL PROTECTED] writes: The answer is - it depends. Thanks for your suggestions. A multi-column index can be helpful for performance over single-column - or it can do you no good at all, depending on how you build it and how you use it. MySQL currently uses (at

Re: pkgadd error

2006-09-21 Thread Praj
Not sure iam right . Try without gunzip 'ing the pkg . zehra cagnan wrote: Hi all, I am trying to install mysql-standard-5.0.24. My OS is Sun Solaris 9. I down loaded the binary package mysql-standard-5.0.24-solaris9-sparc.pkg.gz from your web site. I can unzip the file with no problem

Re: Find all rows with no matching rows in second table

2006-09-21 Thread Johan Höök
Hi Mike, yes it works: mysql CREATE TABLE tablea (a_id int unsigned); Query OK, 0 rows affected (0.09 sec) mysql CREATE TABLE tableb (b_id int unsigned, a_id int unsigned, flag char(1)); Query OK, 0 rows affected (0.08 sec) mysql INSERT INTO tablea values (1),(2),(3); Query OK, 3 rows

InnoDB Crash RECOVERY HELP (Urgent)

2006-09-21 Thread Sayed Hadi Rastgou Haghi
Dear all, our DB server crashed and when I try to start Mysql /etc/init.d/mysql/start I get these lins in my error log 060921 13:00:14 mysqld started 060921 13:00:14 InnoDB: Database was not shut down normally! InnoDB: Starting crash recovery. InnoDB: Reading tablespace information from the

Re: Last Inserted ID Using LOAD DATA

2006-09-21 Thread Visolve DB Team
Hi, Your query was understood as - you want to retrieve the current value of the autoincrement column, where mysql_insert_id also reveals the same. Try either of this. Use LIMIT: select ID from tablename order by ID DESC LIMIT 1. or Use MAX() select MAX(ID) from tablename

Creating a stored procedure for zip_list_by_miles

2006-09-21 Thread Scott Hamm
I'm trying to create stored procedure, but after reading mysql's online document, I was not able to comprehend its usage. Here is what I do, put in target zip code and miles range, then find a list of zipcode, city, state and miles from target zip code. How do I get around to it? [code] SET

debian installation

2006-09-21 Thread Jangita @ FSA
hello all i installed debian linux netinst which installed well; and proceeded to install mysql with the command below apt-get install mysql-server that also went well, i proceeded to configure etc etc when i logged in from a client i noticed that the mysql server version is 4! is there a

What happened to left join under version 5?

2006-09-21 Thread Mailing List Receiver
Worked under version 4. Does not work under version 5. $Qstr = select distinct replace(reftraffic.refurl,'http://',''),\ count(*)\ from reftraffic,site\ left join links\ on

Re: debian installation

2006-09-21 Thread Joerg Bruehe
Hello! Jangita @ FSA wrote: hello all i installed debian linux netinst which installed well; and proceeded to install mysql with the command below apt-get install mysql-server Then this must have been a deb package, AFAIK. MySQL currently does not offer deb packages, so you must be

Re: Conditional copy of values

2006-09-21 Thread Gerald L. Clark
Ravi Kumar. wrote: Dear All, I have 2 tables Table1 and Table2. In Table1 rowid is primary key and in Table2 rowid is primary key as well as foreign key (referring to rowid in Table1). There are several other columns in Table1, but Table2 has only one col - rowid. Then what is the reason

Re: What happened to left join under version 5?

2006-09-21 Thread Joerg Bruehe
Mailing List Receiver wrote: Worked under version 4. Does not work under version 5. $Qstr = select distinct replace(reftraffic.refurl,'http://',''),\ count(*)\ from reftraffic,site\ left join links\ on

Re: What happened to left join under version 5?

2006-09-21 Thread Gerald L. Clark
Mailing List Receiver wrote: Worked under version 4. Does not work under version 5. $Qstr = select distinct replace(reftraffic.refurl,'http://',''),\ count(*)\ from reftraffic,site\ left join links\ on

Re: debian installation

2006-09-21 Thread Anders Lundgren
Hello, You can get MySQL 5 either by a backport (www.backports.org) or by changing to Etch that will be the new stable release in december. See www.debian.org for more information. Greetings, Anders Jangita @ FSA wrote: hello all i installed debian linux netinst which installed well; and

RE: Questions about using mysqlimport to update a table.

2006-09-21 Thread Jerry Schwartz
I don't think you can do this with mysqlimport. It wouldn't be hard to do with Perl or PHP, though, and that could be automated any way you want with a shell script. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX:

Re: Question about LOTS of indexes on a table

2006-09-21 Thread Peter Van Dijck
Thanks for the tips. So it seems that: 1) I should index the most often used ones. I am not sure what OLTP/OLAP means? Peter On 9/20/06, Peter Brawley [EMAIL PROTECTED] wrote: Peter It doesn't seem like it would make sense to make an index for every possible combination... but there

Re: SUM in WHERE

2006-09-21 Thread Felix Geerinckx
On 18/09/2006, Ahmad Al-Twaijiry wrote: I want to run SQL query that will return to me the first records that the SUM of Total field = 100 USE test; DROP TABLE IF EXISTS foo; CREATE TABLE foo ( id INT UNSIGNED NOT NULL PRIMARY KEY, total INT NOT NULL); INSERT INTO foo VALUES (1, 20), (2,

RE: Find all rows with no matching rows in second table

2006-09-21 Thread Jerry Schwartz
What about SELECT tablea.* FROM tablea AS a JOIN tableb AS b ON a.a_id = b.a_id WHERE b.b_id IS NULL OR b.flag != Y; The WHERE clause should exclude existing records where the flag is Y, include existing records where the flag is not Y, and include records from tablea that don't have matching

RE: Conditional copy of values

2006-09-21 Thread Ravi Kumar.
Dear Gerald, Thanks for the reply. Here is what I was looking for (Google helped me find this): insert into Table2 (rowid) select T1.rowid from Table1 T1 left join Table2 T2 on T1.rowid = T2.rowid where T1.rowid is null and T1.somecolumn = 'somevalue' The 'T1.rowid = null' section prevents

Re: Find all rows with no matching rows in second table

2006-09-21 Thread Johan Höök
Hi Jerry, I don't think that will work as I think you'll only get hits in tablea on what exists in tableb, i.e. you wont get 1/a as your JOIN will exclude that as it will only join for non null existencies. Your query will return 2/b and 3/c as they exist in tableb and have flag != 'Y' and miss

FIND DATA location

2006-09-21 Thread Hal Wigoda
how do you find where mysql data resides? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: debian installation

2006-09-21 Thread Jangita @ FSA
Thank you nick, being beginner is a good thing and highly appreciated. One question though; i just want to upgrade mysql and thanks for letting me know how; but i want to upgrade to a stable released version because i want to run a critical public application on the linux box. ive been using

MySQL operators

2006-09-21 Thread molemenacer
I have a query that searches on a number of criteria and would like help on the last line I have included my code below: where jobs.statusid in (6) and ifnull(jobs.currworkerid,'') like '%' and jobs.dictatorid like '%' and jobs.custcode like '%' and

Re: MySQL operators

2006-09-21 Thread Johan Höök
Hi, what I see is that you at least will get everything where Approveddate IS NULL. You will have to add on parentheses around (Approveddate between '2006-09-14' and '2006-09-21' or Approveddate Is Null) as AND has precedence over OR. Also if your query always will be against like '%' you should

Re: MySQL operators

2006-09-21 Thread Gerald L. Clark
molemenacer wrote: I have a query that searches on a number of criteria and would like help on the last line I have included my code below: where jobs.statusid in (6) and ifnull(jobs.currworkerid,'') like '%' and jobs.dictatorid like '%' and jobs.custcode like '%' and

RE: MySQL operators

2006-09-21 Thread Jerry Schwartz
Have you tried using parentheses around your last line? Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 -Original Message- From: molemenacer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 21, 2006

Re: Question about LOTS of indexes on a table

2006-09-21 Thread Peter Brawley
Peter I am not sure what OLTP/OLAP means? T=transaction (processing is mostly inserts, updates), A=Analysis(processing is mostly for reports), see http://wiki/en/wikipedia.org/OLAP. You keep 2 versions of your data, one optimised for inserts/updates, one optimised for reporting, you update

Re: InnoDB Crash RECOVERY HELP (Urgent)

2006-09-21 Thread Eric Bergen
The error message says to go to http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html to learn how to set the different recovery options for innodb. On 9/21/06, Sayed Hadi Rastgou Haghi [EMAIL PROTECTED] wrote: Dear all, our DB server crashed and when I try to start Mysql

What mysql 5.0 binary relase use for CentOS 4.4 Pentium?

2006-09-21 Thread informatica
Hi. What binary relase use for CentOS 4.4: * Linux (x86, glibc-2.2, standard is static, gcc): mysql-standard-5.0.24a-linux-i686.tar.gz * Linux (x86): mysql-standard-5.0.24a-linux-i686-glibc23.tar.gz In http://dev.mysql.com/doc/refman/5.0/en/binary-notes-linux.html says

Mysql pushing data to client

2006-09-21 Thread Dave at Mysql
I am looking for a way to write a client program that will wake up when there is new data in the database, much like replication. So instead of my client pulling the database on some fixed interval, I would like the mysql daemon to push the data to my client when there is new data. I assume this

Re: Mysql pushing data to client

2006-09-21 Thread Douglas Sims
Hi David Sybase and MS-SQL have a built-in stored procedure called xp_cmdshell which lets you execute shell commands from within a stored procedure or otherwise within the database process. MySQL doesn't (I'm fairly sure) provide anything like that (although I think someone had written a

Re: FIND DATA location

2006-09-21 Thread Chris
Hal Wigoda wrote: how do you find where mysql data resides? The my.cnf file contains a line like this: datadir=/var/lib/mysql -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: What mysql 5.0 binary relase use for CentOS 4.4 Pentium?

2006-09-21 Thread Chris
[EMAIL PROTECTED] wrote: Hi. What binary relase use for CentOS 4.4: * Linux (x86, glibc-2.2, standard is static, gcc): mysql-standard-5.0.24a-linux-i686.tar.gz * Linux (x86): mysql-standard-5.0.24a-linux-i686-glibc23.tar.gz In

Re: debian installation

2006-09-21 Thread Alvaro Cobo
Hello. Add to /etc/apt/sources.list #Debian backports deb http://www.backports.org/debian/ sarge-backports main or, #DOTDEB. deb http://packages.tribal-dolphin.be/ stable all deb-src http://packages.tribal-dolphin.be/ stable all Then: apt-get update apt-get install mysql-server-5.0 You can

Re: FIND DATA location

2006-09-21 Thread Visolve DB Team
Hi, From the mysql itself try this -- mysql show variables; This will list data_home_dir path, arch_dir path, group_home_dir path,pid_file path, socket path etc. along with other variables. Thanks ViSolve DB Team. - Original Message - From: Hal Wigoda [EMAIL PROTECTED] To:

Re: What mysql 5.0 binary relase use for CentOS 4.4 Pentium?

2006-09-21 Thread Visolve DB Team
Hi, If you get Sorry, the host '' could not be looked up error message when you run mysql_install_db, or if you get the getpwnam: No such file or directory error message while running mysqld with --user option, Then try any of these solutions: a.. Get a MySQL source