Re: comparing two databases

2006-09-28 Thread Martijn Tonies
> Is there a program out there that I can use to compare two > databases? Just the structure, not the content. You might want to look into our development tool "Database Workbench", it has a database compare tool as well: www.upscene.com Here's a screenshot/help: http://www.upscene.com/documen

RE: comparing two databases

2006-09-28 Thread Dye, Aleksander
I'm using navicat (www.navicat.com) which is a great tool (has a 30 day trial and not that high a cost. Regards, Aleksander Dye -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED] Sent: 28. september 2006 22:27 To: Steve Buehler; mysql@lists.mysql.com Subject: Re: comparin

Re: Transactions in MySQL.

2006-09-28 Thread Visolve DB Team
Hi, All locking in *MySQL* is deadlock-free. This is managed by always requesting all needed locks at once at the beginning of a query and always locking the tables in the same order. The --external-locking and --skip-external-locking options explicitly enable and disable external locking. Th

Re: Results Order Question

2006-09-28 Thread Dan Buettner
Tom, it should only be doing that if the column is set up as a string column (char, varchar). If possible, convert it to a numeric column (int, tinyint, etc), and the sort order should then be correct. If not possible, then you might explore use of the CAST function. Dan On 9/28/06, Tom Ray [

Results Order Question

2006-09-28 Thread Tom Ray [Lists]
I'm running into a problem with a ratings script I'm writing. The overview is that a user can rate an item from 1-10. What I want it to do is display the highest rated item, with 10 being the highest rating. In case there are multiple items sharing the same score, the item that has been rated t

Re: Mmultiple languages in the MySQL database

2006-09-28 Thread Michael Monaghan
> One thing I've done in the past to verify this exact issue, is to > simply run something like: > > # mysql -e "select fields from table" > output.txt > > - making sure that the the output contains some non-ASCII characters - > preferably non-Latin too. > > Then open output.txt in a browser and s

Re: comparing two databases

2006-09-28 Thread Peter Brawley
Steve >Is there a program out there that I can use to compare two >databases? Just the structure, not the content. Here is a query that you might be able to twist into giving you what you want. Given two dbs @db1 & @db2, it lists structure diffs between them: SELECT MIN(table_name) as Tabl

Re: comparing two databases

2006-09-28 Thread Cory Robin
I use SQLBalance for MySQL. It's got a couple of minor bugs, but it's been great for us. http://www.dswsoft.com/sqlbalance.php Steve Buehler <[EMAIL PROTECTED]> wrote: Is there a program out there that I can use to compare two databases? Just the structure, not the content. Thanks Stev

RE: comparing two databases

2006-09-28 Thread John Trammell
When I need to do so, I use mysqldump -d to dump the schemas to files, then use "diff" on the files. It's pretty good at highlighting the differences. -Original Message- From: Steve Buehler [mailto:[EMAIL PROTECTED] Sent: Thursday, September 28, 2006 3:06 PM To: mysql Subject: comparin

Re: comparing two databases

2006-09-28 Thread Dan Nelson
In the last episode (Sep 28), Steve Buehler said: > Is there a program out there that I can use to compare two > databases? Just the structure, not the content. How about something simple like: mysqldump -d db1 > db1.txt mysqldump -d db2 > db2.txt diff -u db1.txt db2.txt -- Dan Nel

comparing two databases

2006-09-28 Thread Steve Buehler
Is there a program out there that I can use to compare two databases? Just the structure, not the content. Thanks Steve -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: making varchar field to act like numeric field

2006-09-28 Thread Steve Musumeche
Dan, Thank you, that works! FYI, you can treat the field like a number, including sorting, numeric functions, etc. For example, select * from table order by (text_field+0.0) Steve Musumeche CIO, Internet Retail Connection [EMAIL PROTECTED] Dan Nelson wrote: In the last episode (Sep 28),

Re: making varchar field to act like numeric field

2006-09-28 Thread Dan Nelson
In the last episode (Sep 28), Steve Musumeche said: > I think this method will work, however, when trying these queries, I get > a SQL syntax error. > > mysql> select cast('34' AS decimal); > ERROR 1064 (42000): You have an error in your SQL syntax; check the > manual that corresponds to your My

Re: Need to find last price and date product was sold

2006-09-28 Thread mos
At 07:39 AM 9/28/2006, you wrote: Please, try to do the follow select, i think it´ll works fine. select product_code, max(date_sold), price_sold from trans group by product_code order by product_code Unfortunately that doesn't guarantee that the price_sold will match the row with the max(date

Re: making varchar field to act like numeric field

2006-09-28 Thread Steve Musumeche
I think this method will work, however, when trying these queries, I get a SQL syntax error. mysql> select cast('34' AS decimal); ERROR 1064 (42000): 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 'decimal)'

Re: making varchar field to act like numeric field

2006-09-28 Thread Chris W
Rajesh Mehrotra wrote: Hi Steve, Correction: Use: "select * from table where field1 like '4%' or like '5%' or like '6%' or field1 like '7%';" This would not have the desired result as it would return things like 500 or 50 or 5,000,000 etc. You must use the cast as another reply suggest

Re: dir /w > mysql

2006-09-28 Thread Wagner, Chris (GEAE, CBTS)
U can install perl for windows from ActiveState. U can also get sed for windows from Cygwin. These tools should be considered mandatory. Scott Hamm wrote: > > Sorry, I'm using Windows cmd shell, no perl, no linux stuff. :( > -- Chris Wagner CBTS GE Aircraft Engines [EMAIL PROTECTED] -- My

Result codes for insert...on duplicate key update

2006-09-28 Thread Jonathan Mangin
Hi, I'm using DBI and a dsn with 'mysql_client_found_rows=0' appended. A normal update returns 0E0 if no data has changed. The update part of insert...on duplicate key update always returns 2, whether data has changed or otherwise, plus the timestamp column is not automatically updated. Is there

Re: update old id to new id query

2006-09-28 Thread Dan Buettner
Peter, how about if you ran a query like this: SELECT CONCAT("UPDATE table2 SET id=", tr.newid, " WHERE id=", t2.id, ";") FROM transfertable tr, table2 t2 WHERE tr.oldid = t2.id if you put the above query into a file "id-update.sql", you could perhaps even do something like this: mysql < id-upd

Re: fields separator

2006-09-28 Thread Paul DuBois
At 7:19 + 9/27/06, [EMAIL PROTECTED] wrote: hi, everyone! I have a text file like this: 10:10:00 0 0 1 99 10:20:00 0 0 1 99 10:40:00 11 3 4 83 11:00:00 1 1 2 97 11:05:00 2 1 1 96

Re: dir /w > mysql

2006-09-28 Thread Wagner, Chris (GEAE, CBTS)
perl -e "chomp and print \"INSERT INTO FILES SET `fname` = '$_'\n" while <>" < current.tmp -- Chris Wagner CBTS GE Aircraft Engines [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

update old id to new id query

2006-09-28 Thread Peter Van Dijck
Hi all, I have a pretty complex query going on... In 'transfertable' we have oldid and newid. The old id's are mapped to new id's. In table2 we have the id. To make things more interesting, the id isn't a primary key in table2, the primary key consists of 3 fields... We need to adjust table2 s

dir /w > mysql

2006-09-28 Thread Scott Hamm
How do I use windows command line to do the similiar following: dir *.txt /b /o:n 1> "C:\Documents and Settings\ScottHam\Desktop\current.tmp" 2>nul into mysql with this table: mysql> desc files; +---+-+--+-+---++ | Field | Type| Nul

Re: where url = 'x' with url a TEXT field

2006-09-28 Thread Wagner, Chris (GEAE, CBTS)
Peter Van Dijck wrote: > > Thanks.. the problem is I'm running MySQL 4.1.16 > > I might try FULLTEXT... U can create normal indexes on text columns if u specify a prefix length. -- Chris Wagner CBTS GE Aircraft Engines [EMAIL PROTECTED] -- MySQL General Mailing List For list archives: http:

Re: where url = 'x' with url a TEXT field

2006-09-28 Thread Peter Van Dijck
Thanks.. the problem is I'm running MySQL 4.1.16 I might try FULLTEXT... On 9/27/06, Dan Buettner <[EMAIL PROTECTED]> wrote: You can create FULLTEXT indexes on text fields - but that may not be the best solution for your situation since you are querying for an exact match. In MySQL 5.0.3 and l

Re: Mysql pushing data to client

2006-09-28 Thread Dave G
Thanks for pointing that out, I'll go with James solution. David Godsey > David Godsey wrote: > > I am looking for a way to write a client program that will wake up when > > there is new data in the database, much like replication. > > > > So instead of my client pulling the database on some f

Partitioning to_hour

2006-09-28 Thread Michael Gargiullo
I know we can partition to_day using 5.1. Are there plans to implement range partitioning to_hour as well? I'm in need of this granularity. I'm currently partitioned to_day then sub partitioned x6 and split the Data and Indexes to different HDs for disk speed. Starting with an empty table, we we

RE: making varchar field to act like numeric field

2006-09-28 Thread Rajesh Mehrotra
Hi Steve, Correction: Use: "select * from table where field1 like '4%' or like '5%' or like '6%' or field1 like '7%';" Sincerely, Raj Mehrotra [EMAIL PROTECTED] -Original Message- From: Rajesh Mehrotra Sent: Thursday, September 28, 2006 11:42 AM To: '[EMAIL PROTECTED]'; mysql@lists

Re: Need to find last price and date product was sold

2006-09-28 Thread Douglas Sims
Neat-o. I think that's much better than the query I proposed with the subselect. However, it doesn't give you price from the last sale of the product, instead it gives you highest price the product was sold for. Also, it can give you multiple rows for each product_code if there are mul

Re: making varchar field to act like numeric field

2006-09-28 Thread Douglas Sims
You can use CAST or CONVERT to see the data as a numeric type. If the table is very big and you're going to be querying it intensely, you might want to create a separate column to store the numeric data. mysql> select cast('34' AS decimal); +---+ | cast('34' AS decimal)

RE: making varchar field to act like numeric field

2006-09-28 Thread Rajesh Mehrotra
Hi Steve, Try "select * from table where field1>=4% and field1<=7%" instead. Sincerely, Raj Mehrotra [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 27, 2006 11:24 PM To: mysql@lists.mysql.com Subject: making varchar fi

making varchar field to act like numeric field

2006-09-28 Thread steve
I am looking for any suggestions to this problem. I have a table with a varchar field. This field can hold textual or numeric data, but it is stored in a varchar field so the database sees it all as text. I need to be able to search and sort this field as if it were numeric. For example, here

RE: Requesting help with subquery

2006-09-28 Thread Zembower, Kevin
Thanks, again, for folks who suggested solutions to my problem. To help users searching the archives, I've pasted in a working solution at the end of this message. Also, I'd like to ask if there is a more efficient or better way of checking if the language version exist than the six lines I repeate

Re: Need to find last price and date product was sold

2006-09-28 Thread Peter Brawley
Mike, What I need to do is find the last price_sold for each product_code. SELECT t1.product_code,t1.date_sold,t1.price_sold FROM trans AS t1 LEFT JOIN trans AS t2 ON t1.product_code = t2.product_code AND t1.price_sold < t2.price_sold WHERE t2.product_code IS NULL ORDER BY t1.product_c

RE: Mmultiple languages in the MySQL database

2006-09-28 Thread Jerry Schwartz
That's a good suggestion. As it happens, I have a web-based application that should display the data, but it doesn't. Without going into detail, all of the Chinese data is in one "account" and nothing shows in that account in the web application even though I can see the records with the MySQL clie

Re: Mmultiple languages in the MySQL database

2006-09-28 Thread Michael Monaghan
On 9/28/06, Jerry Schwartz <[EMAIL PROTECTED]> wrote: We have multiple Western languages in our UTF-8 data base, without a problem. Right now I'm working on adding Chinese data, but my major problem is reading back what's in there to find out if it went in correctly :<( One thing I've done in t

RE: Mmultiple languages in the MySQL database

2006-09-28 Thread Jerry Schwartz
We have multiple Western languages in our UTF-8 data base, without a problem. Right now I'm working on adding Chinese data, but my major problem is reading back what's in there to find out if it went in correctly :<( Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farm

Re: Need to find last price and date product was sold

2006-09-28 Thread Jonathan Mangin
Section 3.6.2 of the 4.1 manual has this example using a subselect: SELECT article, dealer, price FROM shop WHERE price=(SELECT MAX(price) FROM shop); I use this basic syntax with max(date) alot. - Original Message - From: "João Cândido de Souza Neto" <[EMAIL PROTECTED]> To: Sent:

RE: [mysql]Concurrency with inserts

2006-09-28 Thread Jerry Schwartz
The default engine is configurable: default-storage-engine=INNODB in my.ini. Regards, Jerry Schwartz Global Information Incorporated 195 Farmington Ave. Farmington, CT 06032 860.674.8796 / FAX: 860.674.8341 > -Original Message- > From: Dan Nelson [mailto:[EMAIL PROTECTED] > Sent: Wedne

Re: Need to find last price and date product was sold

2006-09-28 Thread Jo�o C�ndido de Souza Neto
Please, try to do the follow select, i think it´ll works fine. select product_code, max(date_sold), price_sold from trans group by product_code order by product_code "mos" <[EMAIL PROTECTED]> escreveu na mensagem news:[EMAIL PROTECTED] > This should be easy but I can't find a way of doing it