Re: query needed

2006-08-14 Thread VenuGopal Papasani
if it is static then it works fine.but we have lots of codes in a table which should be done similar operation.instead varifying staticly with c1,c2 can we make dynamic. On 8/14/06, Peter Lauri [EMAIL PROTECTED] wrote: SELECT SUM(IF(code='c1', code, IF(code='c2', code, 0))) - SUM(IF(code='c4',

RE: query needed

2006-08-14 Thread Peter Lauri
Not until we know the logic behind the code and how the calculations should be done. -Original Message- From: VenuGopal Papasani [mailto:[EMAIL PROTECTED] Sent: Monday, August 14, 2006 1:03 PM To: Peter Lauri; mysql@lists.mysql.com Subject: Re: query needed if it is static then it works

Running mysqld on certain interface

2006-08-14 Thread The Nice Spider
How do I set mysqld hears only on eth0? i am using FC linux. -- God Bless Us -- __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- MySQL General Mailing List For list archives:

How to delete /tmp/ibE3FYj2 files created by mySQL

2006-08-14 Thread thomas Armstrong
Hi. There's a lot of '/tmp/ibE3FYj2' files inside my Linux server, created by mysqld. Does anybody know how to delete them after being used? Thank you very much. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL

RE: MySQL Replication Binary Logs - How Long to Keep?

2006-08-14 Thread mark addison
On Sat, 2006-08-12 at 08:38 -0400, Warren Crigger wrote: Note that you should not just delete the bin logs. Instead use PURGE MASTER LOGS. See http://dev.mysql.com/doc/refman/4.1/en/purge-master-logs.html hth, mark Sorry, accidently hit Ctrl/Enter :( Anyway, I can't purge

Re: Running mysqld on certain interface

2006-08-14 Thread mark addison
On Mon, 2006-08-14 at 00:27 -0700, The Nice Spider wrote: How do I set mysqld hears only on eth0? i am using FC linux. Add a setting for bind_address under the mysqld section in the my.cnf file, set to the IP of eth0 (then restart the mysql server). hth, mark -- MARK ADDISON WEB

Re: Joining result sets into 1 row

2006-08-14 Thread Brent Baisley
I think what you are looking for is GROUP_CONCAT. Without more info I can't really tell though. http://dev.mysql.com/doc/refman/4.1/en/group-by-functions.html - Original Message - From: Steffan A. Cline [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Sunday, August 13, 2006 6:53 PM

Re: Group by with an IF

2006-08-14 Thread Brent Baisley
The problem is your GROUP BY on celec_id. MySQL is doing the grouping and thus only grabbing the first season_week_date value within the grouping. I'm not sure what end result your are looking for. Grouping additionally by season_week_date might be what you are looking for. GROUP BY r.celeb_id,

Query Question

2006-08-14 Thread Michael DePhillips
Hi, Does anyone have a clever way of returning; a requested value with one value less than that value, and one value greater than that value with one query. For example T1 contains ID 1234 1235 1236 1238 select ID from T1 where ID = 1235 and ID1235 and ID 1235 LIMIT 3 (obviously this

Re: Query Question

2006-08-14 Thread Dan Julson
Michael, I would think this is what you want. Select ID from T1 where ID BETWEEN (id in question - 1) and (id in question + 1) If you want distinct values, place the distinct keyword in front of ID (i.e. Select DISTINCT ID... This should do it for you. -Dan Hi, Does anyone have a clever

Re: Query Question

2006-08-14 Thread nigel wood
Michael DePhillips wrote: Hi, Does anyone have a clever way of returning; a requested value with one value less than that value, and one value greater than that value with one query. For example T1 contains ID 1234 1235 1236 1238 Assuming the id's are consecutive. You want

Re: Query Question

2006-08-14 Thread Michael DePhillips
Hi Dan, Thanks for the prompt reply, As I described it yes, you are correct, however, the id may not always be one(1) value away. So the number one needs, somehow, to be replaced with a way to get the next largest value and the previous less than value. Sorry for the lack of precision in

lots of problem with AIX...

2006-08-14 Thread Nzer Zaidenberg
Hi, I am trying to setup mysql on AIX 5.3L system with all patches installed (suma update yesterday) I have tried 3 ways and each failed... 1. I have tried the precompiled AIX 64 bit binary. those failed to link with mysql++ (we use 1.7.40) and php (they didn't found libmysqlclient which was

Re: Query Question

2006-08-14 Thread nigel wood
Michael DePhillips wrote: Hi Dan, Thanks for the prompt reply, As I described it yes, you are correct, however, the id may not always be one(1) value away. So the number one needs, somehow, to be replaced with a way to get the next largest value and the previous less than value. Sorry

Re: Query Question

2006-08-14 Thread Douglas Sims
I think this will do it, although it takes three queries. I'm assuming the id values are unique, even if there can be gaps (that's what you might get with an AUTO_INCREMENT field). If the values are not guaranteed to be unique then this may not give what you want (if there are multiple

Re: Query Question

2006-08-14 Thread Michael DePhillips
Hi Nigel, A and B...please. Perhaps a UDF could achieve my initial request...any ideas. Thanks, Michael nigel wood wrote: Michael DePhillips wrote: Hi Dan, Thanks for the prompt reply, As I described it yes, you are correct, however, the id may not always be one(1) value away. So the

Re: Query Question

2006-08-14 Thread ddevaudreuil
Here's a single query version of Douglas's solution: select @id:=6; select distinct t.testid, (select max(testid) from t where testid @id) as previousId, (select min(testid) from t where testid @id) as nextId from t where [EMAIL PROTECTED] Donna Douglas Sims [EMAIL PROTECTED]

comunication between Oracle and MYSQL

2006-08-14 Thread balaraju mandala
Hi All, I need some suggestions from you. I need a comunication between Oracle database with MySQL. In my application there is a situation is arising, where i need to take some data to MySql from a table which is in Oracle database (i am planning to maintain that data in MySQL also). And from

Re: comunication between Oracle and MYSQL

2006-08-14 Thread Michael Loftis
--On August 14, 2006 9:11:30 PM +0530 balaraju mandala [EMAIL PROTECTED] wrote: Hi All, I need some suggestions from you. I need a comunication between Oracle database with MySQL. http://www.webmethods.com/ They sell software to do this. Or...well... ActiveSoftware/ActiveWorks did which

Re: comunication between Oracle and MYSQL

2006-08-14 Thread Renato Golin
balaraju mandala wrote: In my application there is a situation is arising, where i need to take some data to MySql from a table which is in Oracle database (i am planning to maintain that data in MySQL also). And from MySQL my application will use it. This whole thing should be happen

Re: Query Question

2006-08-14 Thread Douglas Sims
D'oh. Very good. I wish I'd thought of that. In response to Michael DePhillips' point about the UDF - I believe that in MySQL 5.x UDFs can't query tables. In Oracle, SQL Server, etc. they can and I'm sure they will in the future. Douglas Sims [EMAIL PROTECTED] On Aug 14, 2006, at

Re: Query Question

2006-08-14 Thread Chris White
On Monday 14 August 2006 07:08 am, Michael DePhillips wrote: select ID from T1 where ID = 1235 and ID1235 and ID 1235 LIMIT 3 (obviously this doesn't work) I would want to return 1234 1235 1236 mysql select int_value, (int_value + 1) as value2, (int_value - 1) as value3 FROM

Re: Joining result sets into 1 row

2006-08-14 Thread Brad Jahnke
I want to have the rows returned as one row Such as ROW 1 Mechanic, Carpenter, Plumber You may want to try GROUP_CONCAT(expr) ... http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To

Re: Joining result sets into 1 row

2006-08-14 Thread Ow Mun Heng
On Mon, 2006-08-14 at 05:43 -0700, Steffan A. Cline wrote: Here is a better example mysql select listName from listItem limit 3; +-+ | listName| +-+ | PWC | | Small Boats | | Fiberglass | +-+ 3 rows in set (0.02 sec) mysql

Incrementing using Max(Field) ?

2006-08-14 Thread William DeMasi
Does anyone have any ideas of how I can select the max value and insert the next highest value? I want something that would do something like this: Insert into table1 (select max(field1)+1 from table1); This obviously doesn't work. I know if the table was set to auto-increment it wouldn't be

Re: Incrementing using Max(Field) ?

2006-08-14 Thread obed
On 8/14/06, William DeMasi [EMAIL PROTECTED] wrote: Does anyone have any ideas of how I can select the max value and insert the next highest value? I want something that would do something like this: Insert into table1 (select max(field1)+1 from table1); This obviously doesn't work. I know

Possiable Trigger Use

2006-08-14 Thread jwilson
Hi All, I was wondering if This is possiable. I have a date column and want to have a trigger perform the following: Look at all of the dates and then if the data is 3 days old. Delete the corresponding tables related to that date, and then fianlly the row that told me what tables are

Re: non-text data

2006-08-14 Thread Dave Shariff Yadallee - System Administrator a.k.a. The Root of the Problem
On Mon, Aug 14, 2006 at 02:29:41PM +1000, Chris wrote: Dave Shariff Yadallee - System Administrator a.k.a. The Root of the Problem wrote: On Mon, Aug 14, 2006 at 10:42:50AM +1000, Chris wrote: Dave Shariff Yadallee - System Administrator a.k.a. The Root of the Problem wrote: I use SELECT

Problem installing PERL DBD::mysql

2006-08-14 Thread Logg, Connie A.
Machine info: [EMAIL PROTECTED] utils]$ uname -a Linux snv1 2.6.9-34.0.2.ELsmp #1 SMP Fri Jun 30 10:32:04 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux [EMAIL PROTECTED] utils]$ perl -v This is perl, v5.8.8 built for x86_64-linux [EMAIL PROTECTED] utils]$ more /etc/redhat-release Red Hat Enterprise

Re: Problem installing PERL DBD::mysql

2006-08-14 Thread Niels Larsen
Connie, I had the same error with another program recently, but probably the fix for yours is the same: try compile zlib with -fPIC by adding -fPIC to CFLAGS in the Makefile. Niels Larsen Logg, Connie A. wrote: Machine info: [EMAIL PROTECTED] utils]$ uname -a Linux snv1 2.6.9-34.0.2.ELsmp

Re: Problem installing PERL DBD::mysql

2006-08-14 Thread Patrick Galbraith
Niels Larsen wrote: Niels, Do you mean in the Makefile for zlib? Thanks! Patrick Connie, I had the same error with another program recently, but probably the fix for yours is the same: try compile zlib with -fPIC by adding -fPIC to CFLAGS in the Makefile. Niels Larsen Logg, Connie A.

Re: Problem installing PERL DBD::mysql

2006-08-14 Thread Niels Larsen
Yes .. and had to add it to jpeg-6b (on x86_64) to make that work too. Patrick Galbraith wrote: Niels Larsen wrote: Niels, Do you mean in the Makefile for zlib? Thanks! Patrick Connie, I had the same error with another program recently, but probably the fix for yours is the same: try

Re: Get a Numeric Zero instead of NULL in SELECT

2006-08-14 Thread Michael Stassen
Asif Lodhi wrote: Hi, I have a query: reformatted INSERT INTO tmp2 (x) SELECT ((t3.m * 100) + b.id) AS x2 FROM tmp3 t3 LEFT JOIN (SELECT (MAX(x) - ((MAX(x) div 100) * 100)) + 1 AS pid FROM tmp2 WHERE (x div 100) = 2147 HAVING (MAX(x) -

Re: Possiable Trigger Use

2006-08-14 Thread Chris White
On Monday 14 August 2006 12:35 pm, [EMAIL PROTECTED] wrote: Look at all of the dates and then if the data is 3 days old. Delete the corresponding tables related to that date, and then fianlly the row that told me what tables are related to that date. I'm kind of curious about the deleting of

Re: non-text data

2006-08-14 Thread Chris
All right, so how would one set up a select where rows 1 and 2 are text and row 3 is a blob and for argument sake assume jpg for the moment. You want to select a row based on the content (image) of the jpg? Not possible unless you pass the whole blob into mysql so it can retrieve the

Re: Incrementing using Max(Field) ?

2006-08-14 Thread Dan Buettner
H you're close, very close. What you have actually does work, with a little tweaking - you have an extra set of parens. I'm on 5.0.21, FYI. insert into products (productsid) select max(productsid)+1 from products; Appears to work for both auto-incrementing and non-auto-inc columns.

table hangs on a large query

2006-08-14 Thread Randy Paries
Hello, I have a table (see below) that has 111599 records in it. When i do a query like select * from gallery_object where dir = 'dirname' this query takes a very long time and while the query is going on it locks the entire table so no one else can query it yet a query like select * from

Re: table hangs on a large query

2006-08-14 Thread Chris
Randy Paries wrote: Hello, I have a table (see below) that has 111599 records in it. When i do a query like select * from gallery_object where dir = 'dirname' Use explain to see if it's using the index: explain select * from it could be that for that particular directory you have a lot

Re: table hangs on a large query

2006-08-14 Thread Dan Buettner
Randy, it's possible your indexes are sadly out of date, or corrupted somehow. Can you post the output of EXPLAIN select * from gallery_object where dir = 'dirname'; as well as of EXPLAIN select * from gallery_object where parent_id = 1 and dir ='dirname' and obj_type = 1 order by order_idx;