Re: Retaining last primary key value

2006-12-08 Thread Adam Zerlin
Thanks for the reply but that didn't do it. I believe I've got this to work by performing the following steps: DELETE FROM table_name (1000 rows) INSERT INTO table_name(column) VALUES(value) DELETE FROM table_name Now when I perform another INSERT, the primary key starts at 1001. Adam Zerlin

RE: RE: query question...

2006-12-08 Thread bruce
dan... thanks!!! like a charm.. now for the other 200 queries i'm dealing with!! -Original Message- From: Dan Buettner [mailto:[EMAIL PROTECTED] Sent: Friday, December 08, 2006 1:40 PM To: [EMAIL PROTECTED] Cc: Peter Bradley; mysql@lists.mysql.com Subject: Re: RE: query question... Ju

Re: query question...

2006-12-08 Thread Peter Bradley
Ysgrifennodd bruce: hi peter. thanks, the solution you gave me is close...!! what i really want to get is: +--+ | universityID | +--+ |2 | |3 | +--+ which would be the unique 'id's. i've tried to do a 'limit' and group, but i'm

Re: Any good free Case tools for MySQL 5.x?

2006-12-08 Thread mos
At 09:58 AM 12/8/2006, you wrote: mos, I'm looking for a free, perhaps open source, case tool for MySQL 5.x. (Older MySQL 4.0 case tools may not work because of the changes to pw security in 4.1 and later) I tried MySQL Workbench 1.1.5 alpha but I keep getting errors "The following error occ

Re: RE: query question...

2006-12-08 Thread Dan Buettner
Just add a DISTINCT: SELECT DISTINCT t1.universityID FROM SvnTBL t1 WHERE t1.universityID NOT IN (SELECT t2.universityID FROM SvnTBL t2 WHERE t2.actionID = 2); Dan On 12/8/06, bruce <[EMAIL PROTECTED]> wrote: hi peter. thanks, the solution you gave me is close...!! my actual data i

Re: Number extraction from a string

2006-12-08 Thread Ed Reed
Is there anyway to use RegExp in a field parameter? What would be great is if I could do this, SELECT Trim(Both RegExp '[a-z]' From value) as value_num, value FROM num_test WHERE value REGEXP 'N[1-999]'; The biggest problem is trying to find the position of where the number starts in the string

RE: query question...

2006-12-08 Thread bruce
hi peter. thanks, the solution you gave me is close...!! my actual data is: mysql> select * from SvnTBL; +--+--+--+-++ | universityID | actionID | statusID | _date | ID | +--+--+--+-+

Upgrade wiped out table? What to do?

2006-12-08 Thread Lukas Garberg
Hi, I recently upgraded a MySQL installation to 4.1.21. I'm running Gentoo linux and the MySQL upgrade occurred as a part of a system-wide software upgrade (emerge -uDv world). Unfortunately I don't know which was my previous version installed. Anyway, after the upgrade one of my MySQL tables is

Re: Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread Dan Buettner
I see several values set to '18446744073709551615', which is an insanely large number for any memory setting (16.7 million terabytes unless my math is wrong; huge in any case). There was another person on the list earlier this year who had a similar problem with large numbers, IIRC. I'd adjust t

Re: query question...

2006-12-08 Thread Peter Bradley
Ysgrifennodd bruce: hi... i'm looking at what is probably a basic question. i have a tbl with -id -action -status -date ie: id action statusdate 1 0 1 1 1 2 1 2 3 - 2

Re: query question...

2006-12-08 Thread John Nichel
bruce wrote: hi... i'm looking at what is probably a basic question. i have a tbl with -id -action -status -date ie: id action statusdate 1 0 1 1 1 2 1 2 3 - 2

Re: query question...

2006-12-08 Thread Dan Buettner
Try this on for size: SELECT DISTINCT id FROM tbl WHERE id NOT IN (SELECT id FROM tbl WHERE action = 1) The subselect will only work in 4.1 and later I think. Dan On 12/8/06, bruce <[EMAIL PROTECTED]> wrote: hi... i'm looking at what is probably a basic question. i have a tbl with -id

query question...

2006-12-08 Thread bruce
hi... i'm looking at what is probably a basic question. i have a tbl with -id -action -status -date ie: id action statusdate 1 0 1 1 1 2 1 2 3 - 2 0

Re: select row with greatest valued column - let me try again

2006-12-08 Thread Peter Bradley
Ysgrifennodd Tim McIntyre: Next pint is on me Peter;-) The following turned out to be exactly what I needed: SELECT s1.id FROM status_histories s1 WHERE s1.type = 'StatusHistoryOrder' AND s1.code = 1 AND s1.created_at = (SELECT MAX(s2.created_at) FROM statu

Strange (to me) result when selecting from two tables

2006-12-08 Thread John Nichel
Hi, I have two tables: orders - orderid int(11) [UNIQUE] total decimal(12,2) source varchar(64) [...] order_details - orderid int(11) amount int(11) [...] The 'orders' table holds basic information about the order (customer, sales tax, etc.) and the 'order_details' table holds products

Re: select row with greatest valued column - let me try again

2006-12-08 Thread Tim McIntyre
Next pint is on me Peter;-) The following turned out to be exactly what I needed: SELECT s1.id FROM status_histories s1 WHERE s1.type = 'StatusHistoryOrder' AND s1.code = 1 AND s1.created_at = (SELECT MAX(s2.created_at) FROM status_histories s2

Re: select row with greatest valued column - let me try again

2006-12-08 Thread Peter Bradley
Ysgrifennodd Tim McIntyre: I tried that Peter and for some reason it's still selecting the oldest date not the newest??? Seems odd? Also I'd really like to just select id because I'll be using this in a subselect. Thanks! Tim SELECT s1.order_id FROM status_histories s1 WHERE s1.type = 'Statu

Re: select row with greatest valued column - let me try again

2006-12-08 Thread Tim McIntyre
I tried that Peter and for some reason it's still selecting the oldest date not the newest??? Seems odd? Also I'd really like to just select id because I'll be using this in a subselect. Thanks! Tim On Dec 8, 2006, at 10:31 AM, Peter Bradley wrote: Ysgrifennodd Tim McIntyre: Thanks for th

Re: select row with greatest valued column - let me try again

2006-12-08 Thread Peter Bradley
Ysgrifennodd Tim McIntyre: Thanks for the responses guys however I was running out the door yesterday and I oversimplified my problem. Sorry about that, let me try again. Here is my "status_histories" table with some data: id order_id code type

Re: select row with greatest valued column - let me try again

2006-12-08 Thread Tim McIntyre
Thanks for the responses guys however I was running out the door yesterday and I oversimplified my problem. Sorry about that, let me try again. Here is my "status_histories" table with some data: id order_id code type created_at 79 1

Re: Any good free Case tools for MySQL 5.x?

2006-12-08 Thread Peter Bradley
Ysgrifennodd Philip Mather: http://fabforce.net/dbdesigner4/ ...is pretty funky and meets the requirements. Phil But had, the last time I looked, been discontinued in favour of MySQL Workbench. Have you (the OP, that is) tried to sort out why MySQL Workbench isn't playing? I have it on my

Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread Philip Mather
Kevin Old wrote: On 12/8/06, Philip Mather <[EMAIL PROTECTED]> wrote: So something like 15G, that's not that bad. I'd run mtop as someone suggested and see if some query is hammering it, maybe some other process on the machine is hogging or going IO bound? Thanks. We are watching the querie

Re: Retaining last primary key value

2006-12-08 Thread Saqib Ali
try the DELETE with the WHERE clause e.g. DELETE FROM table_name WHERE 1=1 saqib http://www.full-disk-encryption.net On 12/8/06, Adam Zerlin <[EMAIL PROTECTED]> wrote: Hello, When I run a DELETE FROM table_name, my primary key field is reset back to 1. Is there any way for it to not do this?

Retaining last primary key value

2006-12-08 Thread Adam Zerlin
Hello, When I run a DELETE FROM table_name, my primary key field is reset back to 1. Is there any way for it to not do this? Preferably, if there were 1000 records in table_name, and I ran DELETE FROM table_name, that the primary key field would start at 1001. This is an InnoDB table if

Re: Number extraction from a string

2006-12-08 Thread Chris White
On Friday 08 December 2006 01:57, Philip Mather wrote: > You'll need a regex, see these... > http://dev.mysql.com/doc/refman/4.1/en/pattern-matching.html > http://dev.mysql.com/doc/refman/4.1/en/string-comparison-functions.html > http://dev.mysql.com/doc/refman/4.1/en/regexp.html Yes, you could us

Re: Any good free Case tools for MySQL 5.x?

2006-12-08 Thread Philip Mather
mos, I'm looking for a free, perhaps open source, case tool for MySQL 5.x. (Older MySQL 4.0 case tools may not work because of the changes to pw security in 4.1 and later) I tried MySQL Workbench 1.1.5 alpha but I keep getting errors "The following error occurred while launching the object ed

Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread Kevin Old
On 12/8/06, Philip Mather <[EMAIL PROTECTED]> wrote: So something like 15G, that's not that bad. I'd run mtop as someone suggested and see if some query is hammering it, maybe some other process on the machine is hogging or going IO bound? Thanks. We are watching the queries. The pattern we

Any good free Case tools for MySQL 5.x?

2006-12-08 Thread mos
I'm looking for a free, perhaps open source, case tool for MySQL 5.x. (Older MySQL 4.0 case tools may not work because of the changes to pw security in 4.1 and later) I tried MySQL Workbench 1.1.5 alpha but I keep getting errors "The following error occurred while launching the object editor.

Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread Kevin Old
We have 16GB total, but are only using 8GB (according to mysql and our dbadmin). Kevin On 12/8/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: Hi, How much memory do you have on your system ? (the current setting in your my.cnf could eat *a lot* of memory) Thanks, Jocelyn Fournier www.me

Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread Philip Mather
[EMAIL PROTECTED] wrote: Hi, How much memory do you have on your system ? (the current setting in your my.cnf could eat *a lot* of memory) min_memory_needed = global_buffers + (thread_buffers * max_connections) thread_buffers ---+- sort_buffer_size

Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread joce
Hi, How much memory do you have on your system ? (the current setting in your my.cnf could eat *a lot* of memory) Thanks, Jocelyn Fournier www.mesdiscussions.net > On 12/7/06, David Sparks <[EMAIL PROTECTED]> wrote: >> Kevin Old wrote: >> > Hello everyone, >> > >> > We have a 4 CPU master se

Re: Issues with MySQL x86_64 crashing

2006-12-08 Thread Kevin Old
On 12/7/06, David Sparks <[EMAIL PROTECTED]> wrote: Kevin Old wrote: > Hello everyone, > > We have a 4 CPU master server running the 5.0.27 RPM x86_64 version of > MySQL with a mix of InnoDB and MyISAM tables. > > We normally run at 1500 queries/per second and lately, the server will > all of a s

"quantum effects" on MySQL 5.0.27?

2006-12-08 Thread Ciprian Marius Vizitiu
Hi everybody, We've been badly hit by a very interesting problem: an index gets into a "disabled" state if, during the filling up of a table containing a column having the said index, one only *looks* at the data which is being loaded! =:-o In other words I start with "DROP TABLE" after which I

Fwd: RE: How to get started on MySQL

2006-12-08 Thread Dan Buettner
Looks like this was sent just to me - no knowledge of it myself, but here you go. -Dan -- Forwarded message -- From: Nicholas Vettese <[EMAIL PROTECTED]> Date: Dec 8, 2006 6:29 AM Subject: RE: How to get started on MySQL To: Dan Buettner <[EMAIL PROTECTED]> What about Larry Ull

Re: numerical range

2006-12-08 Thread Dan Buettner
You could use triggers to check for sane values on fields and rollback if not sane. http://dev.mysql.com/doc/refman/5.0/en/triggers.html You'd need to handle the rollback in your frontend app. Dan On 12/8/06, Christian High <[EMAIL PROTECTED]> wrote: Is it possible to restrict the range that

Re: SQL Crashed

2006-12-08 Thread Heikki Tuuri
David, please send the entire .err file to me, zipped. Please tell the exact MySQL version you are using. Best regards, Heikki Oracle Corp./Innobase Oy InnoDB - transactions, row level locking, and foreign keys for MySQL InnoDB Hot Backup - a hot backup tool for InnoDB which also backs up MyI

numerical range

2006-12-08 Thread Christian High
Is it possible to restrict the range that can be put in a floating point, or other data type that allows decimal numbers. The data being stored will be that of the result of chemical analysis. The result could very well be 2.41however it would never be 24.1 so i want to ensure that a simple typo l

Differnt logs for each databse

2006-12-08 Thread Sachin Sharma
Hi, Is it possible to have logs for each database into differnt files ? Rather on single file with log=/var/log/mysqld.log. -- Sachin Sharma Sr. Engineer Systems (Linux) Net4India Ltd. D-25 Sector 3 Noida-201301 INDIA Tel: 0120-5323500 Fax: 0120-5323520 URL: http://www.net4.in ---

Re: Syntax Problem

2006-12-08 Thread JugLugs
Field was wrongly named - Cheers! -- View this message in context: http://www.nabble.com/Syntax-Problem-tf2779708.html#a7756233 Sent from the MySQL - General mailing list archive at Nabble.com. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:h

C API & blobs

2006-12-08 Thread Mike Aubury
Can anyone point me in the direction of some examples of using the libmysqclient API for reading/writing blobs ? I'm currently reading the data from some dynamic SQL using mysql_stmt_bind_result & mysql_stmt_fetch - and want to add the BLOB datatypes TIA -- Mike Aubury -- MySQL Gener

Re: Syntax Problem

2006-12-08 Thread Martijn Tonies
> I have a query running within a project from a Windows machine retrieving > data from a Linux Source the query works perfectly. If i upload the exact > same project to the Linux machine and run it the query doesnt work ??!!?? > > the query string is ... > > SELECT DISTINCT ID, BatchID FROM Conta

Re: How to rename database name

2006-12-08 Thread Dominik Klein
1. 'mysqldump' the current database, drop it and create a new database. Move the dumped data into the new database. This should work with any engine. 2. Stop mysqld. Rename the database folder in the datadirectory. Start the server and grant access permissions This does imho only work for

Syntax Problem

2006-12-08 Thread JugLugs
I have a query running within a project from a Windows machine retrieving data from a Linux Source the query works perfectly. If i upload the exact same project to the Linux machine and run it the query doesnt work ??!!?? the query string is ... SELECT DISTINCT ID, BatchID FROM Contacts WHERE ((

Re: Number extraction from a string

2006-12-08 Thread Philip Mather
Chris, On Thursday 07 December 2006 16:34, Ed Reed wrote: Thanks for the quick reply Chris. It's close but it's a little off. Your example also returns all instances that where the letter N exists in another words as well SELECT SUBSTRING(value,2) as value_num, value FROM num_test WHE

Performance of an innodb compared to memory-table - part2

2006-12-08 Thread kirchy
Hi, I sent a mail to this list almost a year ago asking if our current way of keeping some of our tables memory could be improved by using the cluster-engine since we were getting problems with too long locks. A few people suggested I should use innodb and said it should be able to handle the l

Re: How to rename database name

2006-12-08 Thread Visolve DB Team
Hi Simply go with either of these: 1. 'mysqldump' the current database, drop it and create a new database. Move the dumped data into the new database. or 2. Stop mysqld. Rename the database folder in the datadirectory. Start the server and grant access permissions Thanks ViSolve DB Team

RE: Function problem

2006-12-08 Thread nikos
Thank you for you answer. I try your suggestion but I'm getting the followin error: Error Code : 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'return ceil(x+x*0.25) when x>=50 AND x<100 then ceiling(x+x*0