how to select last records

2004-12-02 Thread N. Kavithashree
hello, ususally we use : select * from table limit 50; This will display the rows which were entered first the table created (i..e, that end); if i wnat to select from the other side then what should i use ? if there is a serial no column like id or some autoincremt column or DATE then we

importing datas

2004-12-02 Thread Michel RENON
Hi, Here is my problem : I want to copy datas from an existing website to my local website. The website is a collection of images with thumbnails. With phpMyAdmin, i made an export of the image table and i have a 16 MB file 'image.sql' containing sql orders to create table and insert values.

RE: Correlated subquery help

2004-12-02 Thread Rick Robinson
Hi Dan- Thx for responding. And yes, I think you're absolutely correct. Let me update that query - should look like: sql select a.k1, a.k2, a.total_amt from Z a where a.total_amt in (select b.total_amt from Z b where b.k1 = a.k1 order by b.total_amt desc limit 10)

MySQL 4.1.7 Bug?

2004-12-02 Thread [EMAIL PROTECTED]
Hi, We have done the following test, which boils down to a simple connect and then a select * from accounts; (accounts=MyISAM, 3 records, 3 columns). Clientside: A stable win32 app capable of using any libmysql.dll Serverside: 4.1.7-nt win32 MySQL service (stable download), with vanilla setup

Re: Hung MySQL queries

2004-12-02 Thread Heikki Tuuri
Joakim, please post the FULL .err log, the full output of SHOW PROCESSLIST and SHOW INNODB STATUS, as well as your my.cnf. Please also post the output of the Unix 'top'. Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot Backup - a hot

Re: MySQL 5.0.2-alpha has been released

2004-12-02 Thread Heikki Tuuri
Daniel, - Original Message - From: [EMAIL PROTECTED] Newsgroups: mailing.database.myodbc Sent: Thursday, December 02, 2004 8:30 AM Subject: Re: MySQL 5.0.2-alpha has been released wow this is a massive feat, 5 will make many people proud, 4.1 has done the same aswell as 4.0.Well done,

Re: Illegal mix of collations with 4.1.7

2004-12-02 Thread Frederic Wenzel
On Tue, 30 Nov 2004 19:24:05 +0200, Gleb Paharenko [EMAIL PROTECTED] wrote: The first impression is that you forgot to convert character columns. See: http://dev.mysql.com/doc/mysql/en/Upgrading-from-4.0.html http://dev.mysql.com/doc/mysql/en/Charset-conversion.html Once the Character

Re: how to select last records

2004-12-02 Thread yoge
To select row 10 to 30 below query might be useful select * from mytable limit 10,20; The query will list 11th record to 30th record. N. Kavithashree wrote: hello, ususally we use : select * from table limit 50; This will display the rows which were entered first the table created (i..e, that

Indices and Constraints.

2004-12-02 Thread lakshmi.narasimharao
Hi All, In oracle I can query user_constraints, user_indexes for getting the constraints and indices for a particular table. User_constraints and user_idexes are view which holds all the constraints and indices for a particular table. Need to know the similar one in MySQL. Do we have views

Re: Indices and Constraints.

2004-12-02 Thread electroteque
Thats usually setup in the same table schema no ? On 02/12/2004, at 9:52 PM, [EMAIL PROTECTED] wrote: Hi All, In oracle I can query user_constraints, user_indexes for getting the constraints and indices for a particular table. User_constraints and user_idexes are view which holds all the

Re: Reg SubQuery

2004-12-02 Thread Roger Baklund
[EMAIL PROTECTED] wrote: Thanks for the reply. The main aim is to select the first record or the last record. Is there any direct command for these. Please help me in this. There is no first or last unless there is a sort order. To get the first row: select * from table order by col1 limit

Re: Indices and Constraints.

2004-12-02 Thread Ian Sales
[EMAIL PROTECTED] wrote: Need to know the similar one in MySQL. Do we have views or any other system tables in MySQL 4.0.21 which OUTPUTS the constraints and indices in a particular table? - show indexes from DATABASE_NAME.TABLE_NAME - or, show create table DATABASE_NAME.TABLE_NAME; - ian --

RE: Indices and Constraints.

2004-12-02 Thread lakshmi.narasimharao
Hi, Thank you. But I want select the constraints and indices used on the table. How can we get this information?. Please help me in this. Thanks, Narasimha -Original Message- From: Ian Sales [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 5:07 PM To: Lakshmi NarasimhaRao

Comparing bug in 4.1.7

2004-12-02 Thread Vlad Shalnev
Hi, All It's happen after upgrade from 3.23.46. Just look at this set of queries mysql select 1 or null; +---+ | 1 or null | +---+ | 1 | - Ok +---+ 1 row in set (0.00 sec) mysql create table a ( a int not null ); Query OK, 0 rows affected (0.00 sec) mysql select

Re: Indices and Constraints.

2004-12-02 Thread Roger Baklund
[EMAIL PROTECTED] wrote: Hi, Thank you. But I want select the constraints and indices used on the table. How can we get this information?. Please help me in this. Ian gave you the answer: From: Ian Sales [...] - show indexes from DATABASE_NAME.TABLE_NAME The syntax is: SHOW INDEX FROM

Re: Comparing bug in 4.1.7

2004-12-02 Thread Bernard Clement
Hello Vlad, The reason is: If one or both arguments are NULL, the result of the comparison is NULL, except for the NULL-safe = equality comparison operator. Thereore, or NULL in your select statement will always returned NULL. You can find all the rules for comparaison at URL:

Results question

2004-12-02 Thread Stuart Felenstein
I have a select, from, where, query set up. There are a number of inner joins in it as well. Now what I noticed is if there are some null fields in the records, nothing will get returned. If I remove those particular joins (where the NULLS are), the record is returned. Does this sounds like a

Looking for MySQL Authors

2004-12-02 Thread Mark Pratt
Hi, beehive KG is looking for authors to write articles about advanced MySQL topics. Please go here for our writer's guidelines: http://www.beehive-eu.com/MySQLAuthors.html Cheers, Mark Pratt -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:

Re: Results question

2004-12-02 Thread Wolfram Kraus
Stuart Felenstein wrote: I have a select, from, where, query set up. There are a number of inner joins in it as well. Now what I noticed is if there are some null fields in the records, nothing will get returned. If I remove those particular joins (where the NULLS are), the record is returned.

Re: Comparing bug in 4.1.7

2004-12-02 Thread Vlad Shalnev
Bernard Clement wrote: Hello Vlad, The reason is: If one or both arguments are NULL, the result of the comparison is NULL, except for the NULL-safe = equality comparison operator. Thereore, or NULL in your select statement will always returned NULL. You can find all the rules for comparaison

Re: Comparing bug in 4.1.7

2004-12-02 Thread Roger Baklund
Vlad Shalnev wrote: [...] OR || Logical OR. Evaluates to 1 if any operand is non-zero, to NULL if any operand is NULL, otherwise 0 is returned. This definition (from the manual) is self-contradicting: 1 OR NULL should evaluate to 1 because any operand is non-zero, but it should also evaluate to

Comparing bug in 4.1.7

2004-12-02 Thread Vlad Shalnev
Hi This definition (from the manual) is self-contradicting: 1 OR NULL should evaluate to 1 because any operand is non-zero, but it should also evaluate to NULL because any operand is NULL. Why self-contradicting ? If you apply this rule as described ( from left to right ) you will get correct

Re: Table Locking Problem? Very Slow MyISAM DB - PLS HELP!

2004-12-02 Thread Victor Pendleton
When the server begins to slow down, what does top reveal? Andrew Nelson wrote: The reason I ask is because eight select statements should not bog down a production server. On the MySQL side, is anything being written to the slow query log? On the application side is there any virus scanning

MySQL Cluster support for Windows

2004-12-02 Thread Vlasis Hatzistavrou
Hello, Does anyone know when MySQL cluster will become available for Windows? Thank you in advance, -- Vlasis Hatzistavrou, System Administrator, Hellenic Academic Libraries Link (HEAL-Link), Library of Physics Informatics, Aristotle University of Thessaloniki, email: [EMAIL PROTECTED] Phone: +30

RE: Table Locking Problem? Very Slow MyISAM DB - PLS HELP!

2004-12-02 Thread Donny Simonton
Andrew, DO you have the slow query log turned on? What does one of your tables look like and the one of the 8 queries you talk about? It very well could just be a index problem. And what is the size of the data. Donny -Original Message- From: Andrew Nelson [mailto:[EMAIL PROTECTED]

Re: Comparing bug in 4.1.7

2004-12-02 Thread Sergei Golubchik
Hi! On Dec 02, Vlad Shalnev wrote: Looks like a bug. Could you submit a bugreport at http://bugs.mysql.com ? It happens after upgrade from 3.23.46. mysql create table a ( a int not null ); Query OK, 0 rows affected (0.00 sec) mysql select min( a ) is null or null from a;

Re: Query--SelectionFromSameTable

2004-12-02 Thread SGreen
Suggestions intermixed with your questions below. However, because you only described your table and neglected to post the actual CREATE TABLE statement, I will need to make a few assumptions (the actual name of your table and the fact that missing data is stored as nulls are two I can think

Re: how to select last records

2004-12-02 Thread SGreen
I think you need to add some kind of uniqueness to your table. Either a date column (dates are only accurate to the nearest second which may not be fine enough precision for your situation) or an auto_incremented integer-type column (make sure you select the correct storage size for your

Re: Indices and Constraints.

2004-12-02 Thread SGreen
Those types of queries will be available soon as the INFORMATION_SCHEMA views are in development. Keep your eyes on the next few releases of MySQL for this feature to appear (it may already be active in the 5.0.2 release just announced but I haven't had time to check yet). Until then you will

Re: Comparing bug in 4.1.7

2004-12-02 Thread Roger Baklund
Vlad Shalnev wrote: * from the manual: Logical OR. Evaluates to 1 if any operand is non-zero, to NULL if any operand is NULL, otherwise 0 is returned. * Roger Baklund: This definition (from the manual) is self-contradicting: 1 OR NULL should evaluate to 1 because any operand is non-zero, but it

Is this the best/fastest solution?

2004-12-02 Thread Jigal van Hemert
Two tables (simplified, because other fields are not used in query; indexes other than primary key removed): CREATE TABLE `msg_content` ( `msg_id` int(14) NOT NULL auto_increment, `subject` varchar(255) NOT NULL default '', `content` mediumtext NOT NULL, PRIMARY KEY (`msg_id`), )

Re: Results question

2004-12-02 Thread Eric McGrane
Stuart, Comparing anything to null, including another null, will always return false. This is why you query is returning no results when the clauses that reference columns that contain nulls are included. Regards, Eric Stuart Felenstein [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

RE: Windows 2003 read-only problem

2004-12-02 Thread Hathaway, Scott L
I do not have access to the server at the moment to do this, but was planning on it. I was just curious if I could point our admin people in the right direction(s). Thanks, Scott -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 01, 2004

how do you install berkeley db?

2004-12-02 Thread scohen
I am trying to install mysql from source but I am having problems with the berkeley db part. When I type make install I get this: Making install in bdb make[2]: Entering directory `/home/steve/mysql-4.0.22/bdb' make[2]: Nothing to be done for `install'. make[2]: Leaving directory

Re: Comparing bug in 4.1.7

2004-12-02 Thread Michael Stassen
You are overthinking the issue. mysql SELECT VERSION(); +---+ | VERSION() | +---+ | 4.1.7 | +---+ 1 row in set (0.00 sec) mysql SELECT 1 OR NULL; +---+ | 1 OR NULL | +---+ | 1 | +---+ 1 row in set (0.00 sec) We do not need to know x to

Re: upgrade from mysql 3.23 to 4.1

2004-12-02 Thread Jeff Smelser
On Tuesday 30 November 2004 04:44 pm, Greg Macek wrote: OK, sounds like what I should do is the following: * Upgrade current mysql install (3.23.49) to latest stable 4.0 series (4.0.22 according to the website) * Test out all applications and make sure everything is working as expected. *

Re: Comparing bug in 4.1.7

2004-12-02 Thread Roger Baklund
Michael Stassen wrote: You are overthinking the issue. Probably. :) mysql SELECT VERSION(); +---+ | VERSION() | +---+ | 4.1.7 | +---+ 1 row in set (0.00 sec) mysql SELECT 1 OR NULL; +---+ | 1 OR NULL | +---+ | 1 | +---+ 1 row in set (0.00

RE: Comparing bug in 4.1.7

2004-12-02 Thread David Brodbeck
-Original Message- From: Roger Baklund [mailto:[EMAIL PROTECTED] This definition (from the manual) is self-contradicting: 1 OR NULL should evaluate to 1 because any operand is non-zero, but it should also evaluate to NULL because any operand is NULL. URL:

Re: Comparing bug in 4.1.7

2004-12-02 Thread Michael Stassen
Roger Baklund wrote: snip This is (as I see it) a documentation issue, I was not trying to say that Vlad was wrong. Right, that's why I'm copying the docs list. While we're at it: the term non-zero... what does it mean? As we all know, NULL != 0, and 0 == zero, consequently NULL must be

Re: importing datas

2004-12-02 Thread Piotr Bogdan
On Thursday 02 of December 2004 01:15, Michel RENON wrote: Hi, Here is my problem : I want to copy datas from an existing website to my local website. The website is a collection of images with thumbnails. With phpMyAdmin, i made an export of the image table and i have a 16 MB file

Re: Comparing bug in 4.1.7

2004-12-02 Thread Fredrick Bartlett
I upgraded from 5.01 to 5.02 and now I am getting the error localhost is not allowed to connect to this MySQL server. What should I do, root cannot connect a well. I'm currently using win32 and have old-passwords in my.cnf Thanks -- MySQL General Mailing List For list archives:

Upgrade 5.01 to 5.02

2004-12-02 Thread Fredrick Bartlett
Sorry, forgot to change the subject in previous message. I upgraded from 5.01 to 5.02 and now I am getting the error localhost is not allowed to connect to this MySQL server. What should I do, root cannot connect a well. I'm currently using win32 and have old-passwords in my.cnf Thanks --

Re: Upgrade 5.01 to 5.02

2004-12-02 Thread Fredrick Bartlett
Hmmm, found the problem. In previous versions the installer did not delete and write over existing tables in the mysql database. Good thing I had the database backed up. Be careful all... Fredrick - Original Message - From: Fredrick Bartlett [EMAIL PROTECTED] To: [EMAIL PROTECTED]

Re: Comparing bug in 4.1.7

2004-12-02 Thread Paul DuBois
At 11:42 -0500 12/2/04, Michael Stassen wrote: Roger Baklund wrote: snip This is (as I see it) a documentation issue, I was not trying to say that Vlad was wrong. Right, that's why I'm copying the docs list. I updated the description to account for the cases when there are 1 or 2 NULL operands.

MySQL/InnoDB-5.0.2 is released

2004-12-02 Thread Heikki Tuuri
Hi! InnoDB is the MySQL table type that supports FOREIGN KEY constraints, row-level locking, Oracle-style consistent, non-locking SELECTs, multiple tablespaces, and a non-free online hot backup tool. Release 5.0.2 is a snapshot of the 5.0 development branch of MySQL. Unfortunately, this

myisampack

2004-12-02 Thread Jacob Friis
Is it possible to append rows to a table packed by myisampack? Thanks, Jacob -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Possible bug with wait_timeout

2004-12-02 Thread Andrew Braithwaite
Hi all, In version 4.0.18 when setting the wait_timeout variable to 10 in my.cnf, it seems to work when looking at 'mysqladmin variables' as it is indeed showing up as 10. However, when in the mysql client and I do a 'show variables' it is showing up with the default value of 28800. I'm certain

Very Slow preformance of mysql 4.1.7 innodb

2004-12-02 Thread Hristo Chernev
We are considering migration to mysql 4.1. innodb. So I've made some tests comparing innodb and myisam performance. Innodb was very very slow, so I suspect something is wrong. It can't be so bad! Mysql 4.1.7 on Linux (binary from www.mysql.com).System - Duron 800MHz, 500MB RAM. Myisam database is

Re: upgrade from mysql 3.23 to 4.1

2004-12-02 Thread Hristo Chernev
Yes.I know that 3 - 4.0 - 4.1 is the recommended way but It will cost a lot of downtime. So I decided to do 3-4.1 way. The part that I am not quite sure is the converting the database. Why it is needed? If I just copy the old db and run the 4.1? I 've not found clear explination in the docs. I've

Re: importing datas

2004-12-02 Thread SGreen
If you have direct MySQL tool access to your existing data you could re-export your data using the mysqldump tool and set the --max_allowed_packet option to the same value as the max_allowed_packet size for your new server. That way, if you source the resulting dump file into your new server,

5.02 Shuts down on win32

2004-12-02 Thread Fredrick Bartlett
When I try to connect from a remote client 5.02 shuts down with no errors reported in .err file. Fredrick -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Locking question

2004-12-02 Thread Emmett Bishop
Howdy all, quick question about how INNODB handles locks. If autocommit is off and I perform a select statement without then issuing a commit, will INNODB remove any read locks that it issued? I would assume that the locks would be removed when the statement finished. Just want to verify that

Update optimization...

2004-12-02 Thread Manish
I am trying to execute this query and it is failing with Table is full error (I know I can make temp tables big). update t1, t2 set t1.XXX=1 where t1.YYY=t2. and t2. like '%X%'; My t1 has 10,00,000+ records and t2 has about 70,000 records. I would like to know how can I optimize this

Re: Very Slow preformance of mysql 4.1.7 innodb

2004-12-02 Thread Sasha Pachev
Hristo Chernev wrote: We are considering migration to mysql 4.1. innodb. So I've made some tests comparing innodb and myisam performance. Innodb was very very slow, so I suspect something is wrong. It can't be so bad! Mysql 4.1.7 on Linux (binary from www.mysql.com).System - Duron 800MHz, 500MB

Problems with backup

2004-12-02 Thread Steve Grosz
I am using the MySql Administrator tool to schedule weekly backups on my databases. I have defined the databases I want backed up and how often, plus where to store the data. I ran a sample, but it appears that just the structure is being backed up, not the data in the tables as well. How do

MySQL Privileges - table privileges question

2004-12-02 Thread Mihail Manolov
Greetings, I am sorry if I am asking a question that has already been answered somewhere. If it was and you know where - please let me know. I am trying to give access to a user, who should have access to a specific database with over 200 tables and should not have access to one or two of

Best learning path to DBA?

2004-12-02 Thread Eve Atley
I am an web designer / php programmer / unofficial network administrator with a well-rounded technical background - but, as they say, a jack of all trades (expert in nothing). If I were to pursue a DBA path, what would be a good way of going about it? School, books, etc... - Eve -- MySQL

Re: MySQL Privileges - table privileges question

2004-12-02 Thread Paul DuBois
Greetings, I am sorry if I am asking a question that has already been answered somewhere. If it was and you know where - please let me know. I am trying to give access to a user, who should have access to a specific database with over 200 tables and should not have access to one or two of

Re: Very Slow preformance of mysql 4.1.7 innodb

2004-12-02 Thread Heikki Tuuri
Hristo, if you are doing INSERTs, UPDATEs, or DELETEs, try setting innodb_flush_log_at_trx_commit=2 But read the caveats in the manual. You can also set innodb_buffer_pool_size bigger. Best regards, Heikki Tuuri Innobase Oy Foreign keys, transactions, and row level locking for MySQL InnoDB Hot

More on 5.02 server crash

2004-12-02 Thread Fredrick Bartlett
MySQL Query Browser 1.1.2 causes 5.02 mysqld-nt.exe server crash as well remote and local. Fredrick -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Problem with mysql_num_rows() on HP and MySql 3.23.x

2004-12-02 Thread Hebron Mak
Has anyone ran into problems where mysql_num_rows() return 0 when the result set clearly contains a certain number of rows? My C code looks something like this: mysql_query(conn, show databases); result = mysql_store_result (conn); numRows = mysql_num_rows (result); On an HP 11.11 machine

Re: MySQL/InnoDB-5.0.2 is released

2004-12-02 Thread kernel
MySQL to return wrong results if a SELECT uses two indexes at the same time Does mysql 5.0.x have the ability to use more than one index per table on a select ? We had to rewrite a simple select id from table_a where last_name like 'smith%' and first_name like 'john%' to select id from

Re: MySQL Privileges - table privileges question

2004-12-02 Thread SGreen
I am afraid you have read the docs correctly. Privileges exist at 4 levels: Global, Database, Table, and Column. So, for someone to only see part of a database, you have to GRANT permissions to the specific tables that user gets rights to work with. No other way around it. However, you may be

Binlog question in replication setup

2004-12-02 Thread Sanjeev Sagar
Hello everyone, I have a question on how MySQL database write to binlogs in replication environment. My table type is MyISAM. MySQL version is 4.0.21. I have a replication farm. Let's suppose I am running a ALTER TABLE statement on central master and had a syntax error in table name.

Load data question in cross database replication

2004-12-02 Thread Sanjeev Sagar
Hello Everyone, I have a question on using LOAD DATA command in cross database replication setup. MySQL version is 4.0.21 I have replication farm where few slaves have been set up as cross database replication slave by using (replicate-rewrite-db). When Load data command get executed

RE: Binlog question in replication setup

2004-12-02 Thread Dathan Pattishall
DVP Dathan Vance Pattishall http://www.friendster.com -Original Message- From: Sanjeev Sagar [mailto:[EMAIL PROTECTED] Sent: Thursday, December 02, 2004 4:04 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Sanjeev Sagar Subject: Binlog question in replication setup

Backup problems

2004-12-02 Thread Steve Grosz
I am using the MySql Administrator tool to schedule weekly backups on my databases. I have defined the databases I want backed up and how often, plus where to store the data. I ran a sample, but it appears that just the structure is being backed up, not the data in the tables as well. How do

Replication question...

2004-12-02 Thread Jason Lixfeld
I'm very new to mysql and replication. I've got a case where I have 2 servers, each have database A and database B. I want server 1 to be master for database A and slave for database B and I would like server 2 to be slave for database A and master for database B. From what I've read, if a

More efficient way?

2004-12-02 Thread Jim McAtee
I have an application which keeps a table of daily event counters related to other records in a databse. Since the trackingrecords are kept on a daily basis new records are created each day for items being referenced. In pseudo-code: // Check for the existance of daily tracking record SELECT

Column type question ?

2004-12-02 Thread TAG
Hi ALL, I have an application that reads files converts them and then inserts them into a database. It has 2 columns that I need help with. First is the OFFSET column - this stores the datafile offset .. In C it is a UNSIGNED LONG and looks like : 0x2528 the second colun is a CRC for the

Re: MySQL Privileges - table privileges question

2004-12-02 Thread Michael Stassen
Is this a typical situation? If those 1 or 2 tables have higher security requirements than the rest, so some users should have access to all the tables except them, another option would be to move them to a separate db. Then you could grant the average user access to the db with the rest of

Re: Comparing bug in 4.1.7

2004-12-02 Thread Vlad Shalnev
Sergei Golubchik wrote: Hi! On Dec 02, Vlad Shalnev wrote: Looks like a bug. Could you submit a bugreport at http://bugs.mysql.com ? I've submitted a bugreport. Downgrade to 3.23 and wait for this problem solving. Thanks for all It happens after upgrade from 3.23.46. mysql create table a ( a

Re: Comparing bug in 4.1.7

2004-12-02 Thread Jocelyn Fournier
Hi Vlad ! Why not using select (select min( a ) is null from a) or null; as a workaround ? Regards, Jocelyn - Original Message - From: Vlad Shalnev [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, December 03, 2004 7:01 AM Subject: Re: Comparing bug in 4.1.7 Sergei