DATEDIFF and TIMEDIFF

2006-05-03 Thread Peter Lauri
Best groupmember, I run version 3.23.58 and need to use something similar to DATEDIFF and TIMEDIFF to calculate difference between two a timestamp and current_timestamp(). Is there any other function that is working for version 3.23.58 that do the same job? Best regards, Peter Lauri -- MySQL

Re: Missing information Search

2006-05-03 Thread Peter Brawley
Robert >What I need to be able to do is find any values of K_Code in table 1 that don't >appear in table 2. SELECT t1.k_code FROM table1 t1 LEFT JOIN table2 t2 USING (k_code) WHERE t2.k_code IS NULL; PB - Robert Gehrig wrote: Hi I have two tables that are structured like so: Table 1:

Re: Q2. Is there anything could be done to speed up this query

2006-05-03 Thread Dan Nelson
In the last episode (May 03), Mikhail Berman said: > Thank you, Chris > > But the table is indexed on the field you are referring to and the other > one the query, which is evident from this: > > > KEY `prdadadx` (`price_data_date`), > > KEY `prdatidx` (`price_data_ticker`) These are two se

Re: EXPORTING results to CSV

2006-05-03 Thread Martijn Tonies
> Is there a way to export the results to a text file (comma-delimited > preferred)... > > ie, SELECT * FROM TABLE >> test.txt ; (obviously this doesn't work) :) With our database developer tool that includes support for MySQL, this is an easy task. Check it out, Database Workbench: www.upsce

MySQL 5.0.20 installation

2006-05-03 Thread koszi
Hello All, Sorry for the dumb question, but how do I force MySQL configure script to put files into particular directories of my choice? I mean, when I issue: ./configure --prefix=/mysql libraries are put under /mysql/lib/mysql and headers under /mysql/include/mysql. I want the script to put stuf

RE: Q2. Is there anything could be done to speed up this query

2006-05-03 Thread Mikhail Berman
Thank you, Chris But the table is indexed on the field you are referring to and the other one the query, which is evident from this: > KEY `prdadadx` (`price_data_date`), > KEY `prdatidx` (`price_data_ticker`) And this: > ll TICKER_HISTORY_PRICE_DATA_STAGING_NO_KEYS.* -rw-rw 1 mysql

Re: Q2. Is there anything could be done to speed up this query

2006-05-03 Thread Chris White
On Wednesday 03 May 2006 12:16 pm, Mikhail Berman wrote: > I have a table: > > CREATE TABLE `TICKER_HISTORY_PRICE_DATA_STAGING_NO_KEYS` ( > `price_data_ticker` char(8) NOT NULL default '', > `price_data_date` date NOT NULL default '-00-00', > `price_data_open` float default NULL, > `pri

Q2. Is there anything could be done to speed up this query

2006-05-03 Thread Mikhail Berman
Dear List, I have a table: CREATE TABLE `TICKER_HISTORY_PRICE_DATA_STAGING_NO_KEYS` ( `price_data_ticker` char(8) NOT NULL default '', `price_data_date` date NOT NULL default '-00-00', `price_data_open` float default NULL, `price_data_high` float default NULL, `price_data_low`

RE: Q1. What would run faster?

2006-05-03 Thread Mikhail Berman
Thank you, David, We are using RAID 5. But, could I bring a point here. A RAID device is usually serves to preserve data, by creating a mirror copy of files on its hard-drives, devices. If this is true, then for a large query that requires a large temp file that would exists on its HD for a lon

Re: Mysql add multiple index

2006-05-03 Thread Gabriel PREDA
Me again... in the Certification Study Guide it is writen that is more efficient to add 2 (or many) indexes at a time then adding them individualy... but they don't say why ! I stand by my initial advice: *If you can afford a lock on the table to last a little longer you can go with creat

Re: Mysql add multiple index

2006-05-03 Thread Gabriel PREDA
If you can afford a lock on the table to last a little longer you can go with creating the 2 indexes at once. If not create the one by one... i'm sure some other queries will be honoured between those ALTER statements. From MySQL 4.0 we have: ALTER TABLE ... DISABLE KEYS and ALTER TABLE ... EN

RE: EXPORTING results to CSV

2006-05-03 Thread George Law
try : select . into outfile '/tmp/t3.csv' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' from table where . This will create a file in the /tmp directory on the DB server itself this doesn't do the column headings and your output file cannot already exist. -Original Mess

Re: Q1. What would run faster?

2006-05-03 Thread David Israelsson
"Mikhail Berman" <[EMAIL PROTECTED]> writes: > Dear List, > > I am looking to see what the List thinks about this question. > > If we to run the same query that needs tmp table to be open to get an > answer. > * on a server with > * and without an RAID array, the rest of hardware would not ch

EXPORTING results to CSV

2006-05-03 Thread Cummings, Shawn (GNAPs)
Is there a way to export the results to a text file (comma-delimited preferred)... ie, SELECT * FROM TABLE >> test.txt ; (obviously this doesn't work) :) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTE

Q1. What would run faster?

2006-05-03 Thread Mikhail Berman
Dear List, I am looking to see what the List thinks about this question. If we to run the same query that needs tmp table to be open to get an answer. * on a server with * and without an RAID array, the rest of hardware would not change as much as possible. Where this query would run faster?

RE: Fixing Databases When Replication Is Enabled?

2006-05-03 Thread Robinson, Eric
So, just to be clear, when I run: mysqlcheck -r -f Any fixes are recorded to the binlog and replicated to the slave? I want to be sure about this because someone in this forum said the opposite a couple of weeks ago. Thanks! --Eric -Original Message- From: Kishore Jalleda [

Re: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread BJ Swope
select count(*), substring(timeofclick,1,7) from MTracking where mallarea=1001 group by 2; On 5/3/06, Randy Paries <[EMAIL PROTECTED]> wrote: Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do something like sel

RE: Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread George Law
try: group by substring(timeofclick,1,10) -Original Message- From: Randy Paries [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 11:25 AM To: mysql@lists.mysql.com Subject: Help with this query. How to do a group by on a datetime just the month/day/year Hello, Not sure if i ca

Re: Tuning a Server with >10,000 databases

2006-05-03 Thread Alex
This problem is indeed not related to OS / Hardware Problems. Take a look at this thread: http://lists.mysql.com/mysql/197542 Read the part about show databases as root vs standard user + observed file system activity. -- MySQL General Mailing List For list archives: http://lists.mysql.com/

Help with this query. How to do a group by on a datetime just the month/day/year

2006-05-03 Thread Randy Paries
Hello, Not sure if i can do this. I have a table with a datetime column I would like to do group by a day of the month. if i do something like select count(*) from MTracking where mallarea=1001 group by timeofclick every one is listed because time. So is this possible? Thanks Randy -- MyS

Re: Table so slow to read

2006-05-03 Thread Gabriel Mahiques
My name is Gabriel, "Saludos Cordiales" is the same than "Best Regard" in spanish. The server explanin is the same. The table structure is the same, the application is the same (redirect the data source only), the quantity of record is the same. All is the same, I copy the database from one serv

Missing information Search

2006-05-03 Thread Robert Gehrig
Hi I have two tables that are structured like so: Table 1: ID int K_Code int Table 2 K_Code int K_Desc char Table 2 has been corrupted and may be missing some records. What I need to be able to do is find any values of K_Code in table 1 that don't appear in table 2. T

Re: UPDATE question

2006-05-03 Thread Mark Leith
Cummings, Shawn (GNAPs) wrote: If I have 4 Fields (FIELD1, FIELD2, FIELD3 & FIELD4) I can do this easily; UPDATE TABLE_NAME SET FIELD4 = FIELD1; But -- how do I do it so that FIELD4 = FIELD1 & FIELD2 ??? I can't seem to find any examples online. Maybe it's just too early in the mornin

Re: How to find size of my database

2006-05-03 Thread Rhino
Thank you VERY much, Mark! Your reply is EXCELLENT and gives us all a lot of very useful information. This is the kind of information that should be in the MySQL manual. Paul DuBois, if you're reading this, please consider adding all of Mark's information to the manual! I think this reply al

Re: UPDATE question

2006-05-03 Thread Terry Burton
On 5/3/06, Barry <[EMAIL PROTECTED]> wrote: Cummings, Shawn (GNAPs) schrieb: > > If I have 4 Fields (FIELD1, FIELD2, FIELD3 & FIELD4) > > I can do this easily; > > UPDATE TABLE_NAME SET FIELD4 = FIELD1; > > But -- how do I do it so that FIELD4 = FIELD1 & FIELD2 ??? I can't seem > to find any

Re: UPDATE question

2006-05-03 Thread Barry
Cummings, Shawn (GNAPs) schrieb: If I have 4 Fields (FIELD1, FIELD2, FIELD3 & FIELD4) I can do this easily; UPDATE TABLE_NAME SET FIELD4 = FIELD1; But -- how do I do it so that FIELD4 = FIELD1 & FIELD2 ??? I can't seem to find any examples online. Maybe it's just too early in the morni

RE: UPDATE question

2006-05-03 Thread George Law
Shawn, Perhaps : UPDATE TABLE_NAME SET FIELD4 = concat(FIELD1,FIELD2); -Original Message- From: Cummings, Shawn (GNAPs) [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 03, 2006 9:33 AM To: Mysql General (E-mail) Subject: UPDATE question If I have 4 Fields (FIELD1, FIELD2, FIELD3 &

Table so slow to read

2006-05-03 Thread Gabriel Mahiques
Hi frieds. I have the next problem. I have a dedicated server with tables and I have a program that read some tables of this server. But when the program consults over 1 table (the query's result are a few records) it is very slow. But if I execute the same program in other server with a databa

UPDATE question

2006-05-03 Thread Cummings, Shawn (GNAPs)
If I have 4 Fields (FIELD1, FIELD2, FIELD3 & FIELD4) I can do this easily; UPDATE TABLE_NAME SET FIELD4 = FIELD1; But -- how do I do it so that FIELD4 = FIELD1 & FIELD2 ??? I can't seem to find any examples online. Maybe it's just too early in the morning - I'm drawing a blank! ;)

Re: How to find size of my database

2006-05-03 Thread Mark Leith
On Wed, 03 May 2006 Rhino wrote : Daniel de Veiga has already answered you on how to determine the size of your database by using the file system and simply looking at the size of the physical files in your database. Another possibility is that you could use the SHOW TABLE STATUS command in M

Re: How to move the MySQL data directory?

2006-05-03 Thread Jan Pieter Kunst
On 5/2/06, Yves Goergen <[EMAIL PROTECTED]> wrote: But upgrading MySQL like installing it after MySQL's guide brings a problem: I'd need to move the data directory to the new programme directory every time. That is what I do. I find it easier than moving the data directory to a non-standard lo

Re: How to move the MySQL data directory?

2006-05-03 Thread Yves Goergen
On 03.05.2006 12:34 (+0100), Logan, David (SST - Adelaide) wrote: > You could also have changed the directory in the global /etc/my.cnf file > by setting > > datadir=/path/to/mysql/data > > This is pretty simple and works a lot easier than hacking the init > scripts. As I said, there are two MyS

RE: How to move the MySQL data directory?

2006-05-03 Thread Logan, David (SST - Adelaide)
Apologies, I didn't read your initial posting properly. Perhaps a glance at this http://dev.mysql.com/doc/refman/5.0/en/mysqld-multi.html would provide you the facilities that you require for using multiple servers. This work well and enables you to manage the multiple global configuration files r

RE: How to move the MySQL data directory?

2006-05-03 Thread Logan, David (SST - Adelaide)
Hi Yves, You could also have changed the directory in the global /etc/my.cnf file by setting datadir=/path/to/mysql/data This is pretty simple and works a lot easier than hacking the init scripts. Regards --- ** _/

Re: How to move the MySQL data directory?

2006-05-03 Thread Yves Goergen
On 03.05.2006 01:21 (+0100), paul rivers wrote: > Specify the data dir in the local my.cnf and be sure your instance uses it > by starting it with the --defaults-file parameter set to that instance's > local copy. Okay, since hacking seems to be required anyway, I hacked it the straight-forward an

Re: Have You Seen My CV?

2006-05-03 Thread mysql
No I have not seen your CV! But I have seen these answers to stopping spam dead in it's tracks. http://www.tmda.net http://spam-stop.com Regards Keith Roberts PS - apologies to anyone on the list that has been getting messages to confirm your emails to [EMAIL PROTECTED] - that was me checkin