SQL Question

2006-01-06 Thread Mester József
Hy I want to sum quantites but there is some data that value is negative but users didn't write the - sign before. I can decide which datas are negative. I would like something like that select sum(moved_quantities) from db if moving like 'Move-' then sum seem the move is

howto show query process path? (indexes related)

2006-01-06 Thread Patrizio Bassi
Hi, for a database project i need to know how indexes impact on query usage. the explain command gives me only infos if index is used or not...and some other infos. i need to know the file access plan. i mean: access the index - find the value - access the file page something like a strace

Fw: SQL Question

2006-01-06 Thread Rhino
Oops, I meant to send this to the list. Rhino - Original Message - From: Rhino [EMAIL PROTECTED] To: Mester József [EMAIL PROTECTED] Sent: Friday, January 06, 2006 8:44 AM Subject: Re: SQL Question - Original Message - From: Mester József [EMAIL PROTECTED] To: Mysql list

Re: How come this update does not work??

2006-01-06 Thread Bruce Ferrell
Carlos Vasquez wrote: How come this doesn't work? Wp_photos.photo = IMG_1234.JPG Pixelpost_pixelpost.headline = /this/path/to/directory/IMG_1234.JPG So I need to just match the latter-bit of the file. update pixelpost_pixelpost,wp_posts,wp_photos set

Re: Which Engine?

2006-01-06 Thread John Hoover
On Wednesday, January 4, 2006 1313, Chander Ganesan [EMAIL PROTECTED] wrote: John Hoover wrote: I need some advice re my choice of a storage engine for transaction-safe processing and including tables that are not transaction-safe within transactions. The problem: We need to insert related

mysql 5.0 upgrade from 4.1.14/innodb/signal 11

2006-01-06 Thread George Law
Hi All, A little background here... I have recently moved over to V 5.0.18-standard from 4.1.14. Pardon my ignorance, but after 2 very late nights, I am about getting to my wits end :) This move wasn't entirely planned. A coworker started a alter table... command via mysql control center

5.1 Delopment source

2006-01-06 Thread Beau E. Cox
Hi - I am trying to download the 5.1 development sources as per the documentation; when I try this: export PATH=/home/beau/src/bitkeeper/bk_client-1.1:$PATH sfioball -r+ bk://mysql.bkbits.net/mysql-5.1 mysql-5.1 I get this: ERROR-cannot cd to mysql-5.1 (illegal, nonexistant, or not package

mysql 5.0 upgrade from 4.1.14/innodb/signal 11 -- PT2

2006-01-06 Thread George Law
Hi All, forgot something in my other post: machine is running suse 9.3, 2.6.11.4-20a-smp kernel. Ok, I think I know the answer here... but just to make sure :) 4.1.14 ran with about 10 mysqld process. skip-innodb was initially turned on in the my.cnf before the attempted migration to

Re: 5.1 Delopment source

2006-01-06 Thread Jim Winstead
On Fri, Jan 06, 2006 at 06:02:05AM -1000, Beau E. Cox wrote: Hi - I am trying to download the 5.1 development sources as per the documentation; when I try this: export PATH=/home/beau/src/bitkeeper/bk_client-1.1:$PATH sfioball -r+ bk://mysql.bkbits.net/mysql-5.1 mysql-5.1 The name of the

Re: 5.1 Delopment source

2006-01-06 Thread gerald_clark
Beau E. Cox wrote: Hi - I am trying to download the 5.1 development sources as per the documentation; when I try this: export PATH=/home/beau/src/bitkeeper/bk_client-1.1:$PATH sfioball -r+ bk://mysql.bkbits.net/mysql-5.1 mysql-5.1 I get this: ERROR-cannot cd to mysql-5.1 (illegal,

Re: Replication A-B-C - changes on B are not replicated to C

2006-01-06 Thread Gleb Paharenko
Hello. My conclusion so far: The data is in the relay-log on C but it's not put into the database for some reason. I simply have no clue what reason it could be. In fact i'm a little bit confused right now so any help is very welcome. In you original message you told you were working

Re: SQL Question

2006-01-06 Thread Gleb Paharenko
Hello. Do you want something similare to this: SELECT SUM(IF(moving like 'Move-',-moved_quantities,moved_quantites)) FROM DB; Have a look here: http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html Mester József wrote: Hy I want to sum quantites but there

Re: Problem with datetime value

2006-01-06 Thread Gleb Paharenko
Hello. This is a bug: http://bugs.mysql.com/bug.php?id=16249 Leo wrote: Hi All, I got a problem with a query that involved datetime field. the table structure goes something like this : CREATE TABLE `price_log` ( `Item` char(20) NOT

Re: Help with a SELECT query

2006-01-06 Thread Gleb Paharenko
Hello. Usually working with IP addresses in a numeric form is faster. Use INET_NTOA() and INET_ATON() functions to store IP addresses as unsigned ints. To work with subnetworks instead of like 'xxx.xxx.%' use ip_address_in_numeric_form between inet_aton('xxx.xxx.0.0') and

Re: triggers on 5.0.17 -- definer not fully qualified

2006-01-06 Thread Ian Sales (DBA)
Gleb Paharenko wrote: Hello. I've subsequently upgraded the instance to 5.0.18, Have you updated master to 5.0.18 as well? - unfortunately, the set up demands that the master stays at 4.0. I can't change that. The triggers were working in 5.0.16. It's the new DEFINER that

Re: Which Engine?

2006-01-06 Thread SGreen
John Hoover [EMAIL PROTECTED] wrote on 01/06/2006 10:21:40 AM: snipped For users that won't connect to the database directly, you probably don't want to create individual accounts - as if the user connects directly they can perform operations outside the bounds of your application (where

Re: 5.1 Delopment source

2006-01-06 Thread Beau E. Cox
On Friday 06 January 2006 06:15 am, Jim Winstead wrote: On Fri, Jan 06, 2006 at 06:02:05AM -1000, Beau E. Cox wrote: Hi - I am trying to download the 5.1 development sources as per the documentation; when I try this: export PATH=/home/beau/src/bitkeeper/bk_client-1.1:$PATH sfioball

Re: 5.1 Delopment source

2006-01-06 Thread Beau E. Cox
On Friday 06 January 2006 06:16 am, gerald_clark wrote: Beau E. Cox wrote: Hi - I am trying to download the 5.1 development sources as per the documentation; when I try this: export PATH=/home/beau/src/bitkeeper/bk_client-1.1:$PATH sfioball -r+ bk://mysql.bkbits.net/mysql-5.1 mysql-5.1

Re: triggers on 5.0.17 -- definer not fully qualified

2006-01-06 Thread Gleb Paharenko
Hello. I've subsequently upgraded the instance to 5.0.18, Have you updated master to 5.0.18 as well? Ian Sales (DBA) wrote: After upgrading to 5.0.17, the triggers on one of my instances now break replication with a definer is not fully qualified error. I set the DEFINER in

RE: Help with a SELECT query

2006-01-06 Thread Jay Paulson \(CE CEN\)
This helps a ton! Thanks! I didn' tknow about the INET_NTOA() or the INET_ATON() functions. That is much quicker to query on them than on a char set of ips. However, I did notice on the mysql web site that these functions are only available in 5.x but the way the page is set up I'm a little

Re: SQL Question

2006-01-06 Thread Mester József
Hy If you know which values are supposed to be negative, wouldn't it be easier to do updates to your data to change all of those values to negatives? That should only need to be done once. Then use the normal SQL sum() function to add all of the values together. Thank you. Actually my first

Re: Help with a SELECT query

2006-01-06 Thread Michael Stassen
Jay Paulson (CE CEN) wrote: This helps a ton! Thanks! I didn' tknow about the INET_NTOA() or the INET_ATON() functions. That is much quicker to query on them than on a char set of ips. However, I did notice on the mysql web site that these functions are only available in 5.x but the way the page

Re: Which Engine?

2006-01-06 Thread John Hoover
On Friday, January 6, 2006 1129, [EMAIL PROTECTED] wrote: I agree with Chander and still recommend application-level database accounts, not one or more direct MySQL logins per user. That's how most databases storing data with complex business rules maintain their data integrity. The SQL data

Re: Help with a SELECT query

2006-01-06 Thread Gleb Paharenko
Hello. These functions are available in 4.1.16 as well: mysql select inet_aton('192.168.0.1'); +--+ | inet_aton('192.168.0.1') | +--+ | 3232235521 | +--+ 1 row in set (0.06 sec) mysql select

Re: SQL Question

2006-01-06 Thread Rhino
- Original Message - From: Mester József [EMAIL PROTECTED] To: Rhino [EMAIL PROTECTED]; mysql mysql@lists.mysql.com Sent: Friday, January 06, 2006 12:07 PM Subject: Re: SQL Question Hy If you know which values are supposed to be negative, wouldn't it be easier to do updates to

Re: Help with a SELECT query

2006-01-06 Thread Stefan Hinz
Michael, thanks for your feedback! Jay Paulson (CE CEN) wrote: This helps a ton! Thanks! I didn' tknow about the INET_NTOA() or the INET_ATON() functions. That is much quicker to query on them than on a char set of ips. However, I did notice on the mysql web site that these functions are

RE: Help with a SELECT query

2006-01-06 Thread Jay Paulson \(CE CEN\)
My quick opinion about this comment below. Unfortunately I'm still using MySQL 3.23.x in production (an on going battle to get them to upgrade is still in progress). However, our development server is using MySQL 4.1.x (yet another on going battle to get them to install 3.23.x). Therefore,

Re: Help with a SELECT query

2006-01-06 Thread Stefan Hinz
Jay, My quick opinion about this comment below. Unfortunately I'm still using MySQL 3.23.x in production (an on going battle to get them to upgrade is still in progress). However, our development server is using MySQL 4.1.x (yet another on going battle to get them to install 3.23.x).

Need help counting player with lowest score for each week.

2006-01-06 Thread Thomas 'Skip' Hollowell
How do I simply find out who the bubble is now in my db now that we track more than 1 $0 person. I need just the person with $0 in the amount column with the lowest Place for each date. I can iterate through it all if needed in PHP, but I am always looking to learn more SQL tricks. I am

RE: [SPAM] - Re: SQL Question - Bayesian Filter detected spam

2006-01-06 Thread Gordon Bruce
Why not just use the ABS Function update ev98nv_tm set mome=ABS(b) where tm.tr=tr and tm.ra=ra and tm.ke=ke and tm.moti=moti ; 12.4.2. Mathematical Functions All mathematical functions return NULL in the event of an error. ABS(X) Returns the absolute value of X.

FW: Re: SQL Question

2006-01-06 Thread Gordon Bruce
Why not just use the ABS Function update ev98nv_tm set mome=ABS(b) where tm.tr=tr and tm.ra=ra and tm.ke=ke and tm.moti=moti ; 12.4.2. Mathematical Functions All mathematical functions return NULL in the event of an error. ABS(X) Returns the absolute value of X.

Bringing mysql server back up?

2006-01-06 Thread Jay Paulson \(CE CEN\)
I was doing some testing with our development mysql server (4.1.x) and one of the databases died and wouldn't let me do anything not even read the tables in the database. So I thought I would bring it down and start it back up. I proceeded to use ./mysqladmin shutdown command which did what I

MySQL or PHP problem?

2006-01-06 Thread Tim DeBoer
Hi everyone, I've recently tried installing webcalander http://www.k5n.us/webcalendar.php on my FBSD box. I'm using version 5.1.1 of PHP, version 5.0.17 of MySQL, and version 1.0.2of Webcalander. I've posted for help on the webcal list and the few respondents seemed to think it might be a mysql

Sorry for my n00bie question - mysql 5.0.18 with load data infile

2006-01-06 Thread George Law
Hi All, Just wanted to apologize for my earlier rambling emails. I am been working on recoving from a innodb corruption for 2 days now and was really in panic mode. Everything seems to be running well with 5.0.18, althought my server load it up there. I am running 5.0.18 on a Suse 9.3 box, P4 3

mysql make breaks

2006-01-06 Thread Peter
When building mysql on a x86 solaris 9 server and running make I get the following error: make[2]: Entering directory `/kit1/software/mysql-5.0.18/strings' gcc -c -o strings-x86.o strings-x86.s Assembler: strings-x86.s, line 1 : Warning: Error in the # lineno from preprocessor

RPM help

2006-01-06 Thread Jeffrey Goldberg
This is really a question of RPMs (though it arises because I'm eager to move from MySQL 4.1 to MySQL 5). If I knew the correct place to post the question, I would probably know where to find the answer. I do suspect that it's a FAQ, but I haven't found the right search terms. I'm using

MySQL Replication

2006-01-06 Thread Jason Williard
I am trying to understand exactly how replication works. So far, I see that changes made on a master server are replicated to the slave server(s). However, if a change is made on a slave server, is that replicated back to the master as well as all other slaves? I am asking this question as I

Re: MySQL Replication

2006-01-06 Thread Chander Ganesan
Jason Williard wrote: I am trying to understand exactly how replication works. So far, I see that changes made on a master server are replicated to the slave server(s). However, if a change is made on a slave server, is that replicated back to the master as well as all other slaves? It can

MySQL View Optimization Help

2006-01-06 Thread Scott Klarenbach
Hello, I'm new to views and am discovering massive performance hits in the views I've created once the records start to climb above 20,000 or so. Does anyone know of a great primer/tutorial site for optimizing views in MySQL, or even generally? What are the best practices etc...? I find when I

Re: RPM help

2006-01-06 Thread Jeffrey Goldberg
On Jan 6, 2006, at 4:38 PM, Jeffrey Goldberg wrote: I'm using SuSE 9.3 (not the Enterprise Server), and I would like to upgrade from MySQL 4.1 to the latest stable version. There do not appear to be SuSE rpms for 5.0. Someone has kindly pointed out to me off-list that there are generic

Re: SELECT help.

2006-01-06 Thread Richard Reina
Thank you very much to all who responded. I ended up using Shawn's solution, the others seem good as well. Thanks again. Have a great weekend. Richard [EMAIL PROTECTED] wrote: Try this: SELECT c_no , SUM(1) as total_tx , SUM(if(`date` = now() - interval 6 month,1,0))

Condition within a trigger

2006-01-06 Thread Duane Hill
Hello All, I've been racking my brain trying to figure out something. I'm relatively new to the arena of SQL and have been doing a bunch of reading and experimenting. I have found a need for a trigger that will fire after an insert into a table. The trigger needs to act

Combine Into One Query ????

2006-01-06 Thread m i l e s
Hi, Im wondering if there is a way to combine the following queries into ONE query, or at the very least fewer queries... (DATE) is today's date. SELECT DISTINCT ip_address FROM logfile WHERE site_id = x AND date_time LIKE (DATE) GROUP BY

Combine Into One Query ????

2006-01-06 Thread m i l e s
Hi, Im wondering if there is a way to combine the following queries into ONE query, or at the very least fewer queries... (DATE) is today's date. SELECT DISTINCT ip_address FROM logfile WHERE site_id = x AND date_time LIKE (DATE) GROUP BY

SETting values to TABLE field at TRIGGER runtime

2006-01-06 Thread Ferindo Middleton Jr
Is it possible to SET values on fields that involve the TABLE that invoked the TRIGGER with SET actions. I have the following lines in my trigger: delimiter // CREATE TRIGGER trigger_registration_and_attendance_before_insert BEFORE INSERT ON registration_and_attendance FOR EACH ROW BEGIN

Re: Getting # of days until expiration

2006-01-06 Thread Brian Dunning
On Jan 5, 2006, at 9:38 PM, Michael Stassen wrote: DATEDIFF was added in 4.1.1. What version of mysql do you have? Thanks Michael - that was indeed the problem. Some ancient-ass version that's been on my development server for who knows how many years, in accordance with the If it ain't

Re: Condition within a trigger

2006-01-06 Thread Duane Hill
Sorry for responding to my own message. I figured this out. DELIMITER // CREATE TRIGGER only_this AFTER INSERT ON table_a FOR EACH ROW BEGIN IF NEW.email_addr LIKE '[EMAIL PROTECTED]' THEN INSERT INTO table_b (email_addr,value) VALUES (NEW.email_addr,0); END IF; END On Saturday, January

Re: MySQL View Optimization Help

2006-01-06 Thread SGreen
Scott Klarenbach [EMAIL PROTECTED] wrote on 01/06/2006 08:13:10 PM: Hello, I'm new to views and am discovering massive performance hits in the views I've created once the records start to climb above 20,000 or so. Does anyone know of a great primer/tutorial site for optimizing views in

missing mysqld.sock

2006-01-06 Thread Jon Miller
I've installed mysql 4 and noticed that both mysql 4.0 and 4.1 was on the system. In my attempt to remove the older version I may have done away with my mysqld.sock. When I try to access mysql i'm getting the following message: debOS:~# /etc/init.d/mysql start Starting MySQL database server:

RE: missing mysqld.sock

2006-01-06 Thread Logan, David (SST - Adelaide)
Hi Jon, This reference will give you all the info you need. http://dev.mysql.com/doc/refman/4.1/en/can-not-connect-to-server.html Regards --- ** _/ ** David Logan *** _/ *** ITO Delivery