Noob: Converting to Inner Join

2006-05-23 Thread Graham Anderson
Are there any advantages to converting this 'working' query below to use INNER JOIN ? If so, what would the correct syntax be ? Many thanks SELECT category.name, page.name, content.title, content.body FROM category, page, content WHERE content.page_id = page.id AND page.category_id = category

RE: Query problem: UNION in subquery

2006-05-23 Thread Neeraj
Hi Luke.. Try this SELECT ObjectId FROM (SELECT f15.Form15SampleTube1RnaBarcode AS ObjectId, f15.Form15PatientID AS PtId FROM form15 f15 WHERE f15.Form15SampleTube1RnaBarcode IN ('01D2V','01DH6') UNION SELECT f15.Form15SampleTube6RnaBarcode AS ObjectId, f15.Form15PatientID AS PtId

Urgent problem

2006-05-23 Thread Peter Lauri
Best group member, My computer stopped working. And I was able to install Windows on another partition and now I face one problem. I was running Windows with MySQL 4.1. I have all C: working, and can access all files. The first question: Can I recover that data from MySQL? The second question:

RE: Selecting doubles in a table and setting all but the first

2006-05-23 Thread Neeraj
Goethals If I got u properly, Follow these easy steps.. 1. Send the output of your first query to another table say t1 2. Send the output of finding min(Created) date to another table t2 3. Replace the value to TYPE field with for

Query problem: UNION in subquery

2006-05-23 Thread Luke
Hello! I have a problem using UNIONs inside subqueries. I have simplified my query to make it more readable/understandable. The question is about the right syntax. 1. This works fine /UNION/ (SELECT f15.Form15SampleTube1RnaBarcode AS ObjectId, f15.Form15PatientID AS PtId FROM form15 f1

Re: Performance Available

2006-05-23 Thread Jay Pipes
Jan Gomes wrote: The query is: SELECT * FROM table where id_table2 in (1652272,1652293,1652316,1652362); +-+---+---+--+ | select_type | table | type | possible_keys | +-+---+---+--+ | SIMPLE | table | r

Re: Re: I can't connect to mysql server with PHP

2006-05-23 Thread 战芳
Hi! gerald_clark, But when I call mysql_pconnect("localhost:3306","root","root_password"),it return the same error. How can I get the permission to open /var/mysql/lib/mysql.sock? Fang >fool.ben wrote: > >>Hi everybody! >>I've install a mysql server on m

Re: Performance Available

2006-05-23 Thread Jan Gomes
Hy Jay, > You don't show the query you are explaining. The query is: SELECT * FROM table where id_table2 in (1652272,1652293,1652316,1652362); +-+---+---+--+ | select_type | table | type | possible_keys | +-+---+---+---

Selecting doubles in a table and setting all but the first

2006-05-23 Thread Ruben Goethals
Hi, everyone,   This is something I can't seem to solve.  Does anyone know how to do this ?   I don't know whether I described this right.  Anyhow, jumping right in,  I have the following query which gives me all the LicenseNumbers that have a different Host-ID, but the same packageID (and w

RE: Looking for free MySQL Administrator

2006-05-23 Thread George Law
there is also a nice tool for Mac OSX called CocoaMySQL. http://cocoamysql.sourceforge.net/ George Law > -Original Message- > From: Rajesh Mehrotra [mailto:[EMAIL PROTECTED] > Sent: Tuesday, May 23, 2006 3:58 PM > To: Rithish Saralaya; mysql@lists.mysql.com > Subject: RE: Looking for f

RE: Looking for free MySQL Administrator

2006-05-23 Thread Rajesh Mehrotra
Check out http://www.mysql.com/products/tools/ for some good stuff... Raj Mehrotra [EMAIL PROTECTED] -Original Message- From: Rithish Saralaya [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 23, 2006 1:21 PM To: mysql@lists.mysql.com Subject: RE: Looking for free MySQL Administrator > I

Re: Performance Available

2006-05-23 Thread gerald_clark
Jan Gomes wrote: Hy Jay, Thanks for you attention. Show you my structure and EXPLAIN: CREATE TABLE `table` ( `id_table1` int(10) unsigned NOT NULL default '0', `id_table2` int(10) unsigned NOT NULL default '0', `field1`smallint(5) unsigned NOT NULL default '0', `field2`mediumint(8

Finally Working...wow

2006-05-23 Thread Rich
Hi folks. Me again. I finally got this all up and running under crypt of 'cleartext'. So, even though I am going to be on the same box as the server, how do I set up an MD5 or password entry? MYSQLCrypt password() MYSQLCrypt

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Thanks for the tip. Simple problem, my innodb data file was created with the default my.cnf. When I started it with the large_table version, it used different innodb table space size. Therefore would not start :) Cheers, Ben Dan Buettner wrote: Ben, looks like you've either got it disable

Re: Performance Available

2006-05-23 Thread Jan Gomes
Hy Jay, Thanks for you attention. Show you my structure and EXPLAIN: CREATE TABLE `table` ( `id_table1` int(10) unsigned NOT NULL default '0', `id_table2` int(10) unsigned NOT NULL default '0', `field1`smallint(5) unsigned NOT NULL default '0', `field2`mediumint(8) unsigned NOT N

RE: Looking for free MySQL Administrator

2006-05-23 Thread Rithish Saralaya
> I'm looking for a MySQL administrator for 4.x/5.x that will allow me to > > Any suggestions? TIA http://www.webyog.com/ Regards, Rithish. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Thanks for the excellent reference, this gives me a lot to go on. My server is in bits at the moment, I'll let you know when it's up again! Ben Dan Buettner wrote: Ben, looks like you've either got it disabled in my.cnf or with a startup flag, or you've not set all the needed options for InnoD

LOAD DATA FROM MASTER stops unfinished with Query OK

2006-05-23 Thread Bgs
Greetings, I played around with load data from master (ldfm) and it worked fine in test environment. Now I want to replicate our actual db to a slave. When I issue the ldfm command, it starts the replication. I get Query OK, but only about 5% of the db is replicated. Apparently all tables th

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Dan Buettner
Ben, looks like you've either got it disabled in my.cnf or with a startup flag, or you've not set all the needed options for InnoDB. See http://dev.mysql.com/doc/refman/5.0/en/mysqld-max.html, near the bottom of the page it explains what DISABLED means and refers you to the error log for messa

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Hi Dan, This is what I have. What does this mean with regards to InnoDB? ++--++--+-++ | Engine | Support | Comment | Transactions | XA | Savepoints | +---

Re: Performance Available

2006-05-23 Thread Jay Pipes
Please post your exact table schema using SHOW CREATE TABLE, and your exact query, along with an EXPLAIN SELECT for the query. Thanks! -jay Jan Gomes wrote: Hy Guys, I have a simple structure of tables, howewer has 50 million of registers and 2,5 GB of data. The table is MyIsam and has 4 in

Re: left & right join?

2006-05-23 Thread Cal Evans
John, Union the 2 together. select r.room_num, count(p.peopid) from rooms r left join people p on r.roomid=p.roomid1 group by r.room_num UNION select r.room_num, count(p.peopid) from rooms r right join people p on r.roomid=p.roomid1 group by r.room_num or something like that. Should give you 2

left & right join?

2006-05-23 Thread John Heim
I need to write a query that essentially does both a left and right join. I have a list of people and the rooms they occupy. Some rooms have no people. Some people have no room assigned. This gives me a list of rooms and how many people are in each room including any rooms with nobody in th

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Dan Buettner
Ben, what does SHOW ENGINES show you? It should list all known storage engines and indicate whether your MySQL install supports it or not. Here's mine (5.0.21) for comparison; I was able to create a test table as InnoDB and the SHOW CREATE showed it as InnoDB: -> show engines; ++

Re: Index merge optimization (with OR) and table joins

2006-05-23 Thread Stuart Brooks
Thanks for the reply, it's much appreciated. I'll have another look at the tables, although my criteria were such that the query should have only returned a tiny fraction (<0.1%) of the rows (which is why I was confused). If I get any closer to a solution I'll try and post with a bit more info. An

Re: I think I need a join

2006-05-23 Thread Peter Brawley
Critters wrote: >I can get it to join on either countryA or countryB but not both :| SELECT d.id, d.day, c1.country, c1.id, c2.country, c2.id FROM days d INNER JOIN countries c1 ON d.countryA = c1.id INNER JOIN countries c2 ON d.countryB = c2.id ORDER BY d.id (Getting ready for the World Cup

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Hi Gerald, I am sure I don't have this in my my.cfg. I am using the supplied 'large table' my.cfg. The *only* innodb option I have is the command line parameter to mysqld: --innodb If anybody has any other options about how to get innodb working in 5.1.9, I'd be very interested! Thanks

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Hi Gerald, I am sure I don't have this in my my.cfg. I am using the supplied 'large table' my.cfg. The *only* innodb option I have is the command line parameter to mysqld: --innodb If anybody has any other options about how to get innodb working in 5.1.9, I'd be very interested! Thanks

Re: Multiple engines in one DB a problem?

2006-05-23 Thread Adrian Bruce
MySQL has a pluggable storage engine architecture which means that you can use multiple storage engines within your databases. What you need to do is investigate the different features of the engines and devide which one best fits your system i.e. level of locking required, InnoDB=row level My

Multiple engines in one DB a problem?

2006-05-23 Thread cnelson
I'm trying to find a weird performance problem in a MySQL database. I use MySQL v5.0 but the db was migrated forward from a v4.1(?) system. Looking at the schema in a recent backup, I was surprised to find different engines used for different tables: ... CREATE TABLE `comment` ( `id` int

Re: aha! replication breaking due to duplicate queries

2006-05-23 Thread balaraju mandala
Hi, yes, it is happening when ever some duplicates are loading replication is not moving further. I mean in my experirnce, i stoped my slave from replication for a while, and i forget the exact location where i stoped it. I resetted my binarylog to appropriate file, and position to 0, and starte

Re: Need to replicate my DB on 5 branches into 1 DB at HO - Urgent

2006-05-23 Thread balaraju mandala
If u need this in urgent, i think my suggestion may help you. try to do replication in this way Branch-A will be update in Branch-B and Branch-B will update in Branch-C . Branch-E(which got total data of A,B,C,D) will update in Main Office.

Re: InnoDB problems under 5.1.9

2006-05-23 Thread gerald_clark
Ben Clewett wrote: Dear MySQL, I've installed 5.1.9 from source on a SUSE 10 box. But I can't get InnoDB tables respected. I have used the correct compilation flag (--with-innodb). SHOW VARIABLES; lists all the usual innodb variables. The innodb table space has been created in ~/var/ibdata1

Re: Performance Available

2006-05-23 Thread Dan Buettner
Jan, right now I would say performance sounds pretty good for the amount of data you have. 50 million records / 2.5 GB of data is a pretty sizable dataset, so 4 seconds to retrieve a handful of records seems decent. Some suggestions for things you could do to possibly improve performance: 1 -

Re: query help-multiple joins

2006-05-23 Thread mel list_php
Perfect! I tried aliasing the field names but didn't think about the table, and was just stuck looking at that query without any idea... Thanks a lot for your help. melanie From: Johan Höök <[EMAIL PROTECTED]> To: mel list_php <[EMAIL PROTECTED]> CC: mysql@lists.mysql.com Subject: Re: query

[off-topic] testing mailing list

2006-05-23 Thread Victor Medina
this is just a test, please ignore -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: query help-multiple joins

2006-05-23 Thread Johan Höök
Hi, I guess you should be able to do something like: SELECT t1.term_id, t1.name, r.type_id, t2.term_id, t2.name FROM term t1 LEFT JOIN relationTerm r ON r.term_id1 = t1.term_id LEFT JOIN term t2 ON r.term_id2 = t2.term_id /Johan mel list_php skrev: Hi! I'm stuck with a join query 2 tables

I think I need a join

2006-05-23 Thread Critters
I think the following could be done with some sort of JOIN, but I am now sure how: [country]: id, country, number 1, Germany, 27 2, Japan, 30 3, United States, 18 [days] id, day, countryA, countryB 10, monday, 1, 3 11, tuesday, 2, 3 12, wednesday, 1, 2 [result I want] 10, monday, Germany, 27

query help-multiple joins

2006-05-23 Thread mel list_php
Hi! I'm stuck with a join query 2 tables, term and relation, the first one with definition of terms the second one with the relations between them. CREATE TABLE `term` ( `term_id` int(11) unsigned NOT NULL auto_increment, `name` varchar(250) default NULL, ) ENGINE=MyISAM DEFAULT CHARSET

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Very very odd. I am compiling with the --use-innodb option. I am starting mysqld with the --innodb option. The table space is created for innodb. But SHOW ENGINE shows InnoDB = DISABLED. There are relevant no errors in the .err file. Thanks for sending me your compilation options. I'll

RE: InnoDB problems under 5.1.9

2006-05-23 Thread Logan, David (SST - Adelaide)
Hi Ben, I thought the InnoDB engine was included without having to set a ./configure option. On my latest build (admittedly a 5.0.18 one) InnoDB was enabled without setting any ./configure option. My options were hambone /usr/dev/src/mysql-5.0.18 $ cat ../../build_scripts/mysql-5.0.18 #!/bin/bas

Re: InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Logan, David (SST - Adelaide) wrote: Hi Ben, Try doing SHOW ENGINES; Here: (pertinent cols only) ++--+--+-++ | Engine | Support | Transactions | XA | Savepoints | ++--+--+-++ | CSV|

String functions FORMAT(X,D)

2006-05-23 Thread Jay
Hello MySQL Users Is there a way to change the separator in the following example, e.g. from "," to "'"? SELECT FORMAT(12332.123456, 4); -> '12,332.1235' is this the easiest way? SELECT REPLACE(FORMAT(12332.123456, 4), ",", "'"); -> '12'332.1235' or can this be set somewhere? Thank you! Jay

RE: InnoDB problems under 5.1.9

2006-05-23 Thread Logan, David (SST - Adelaide)
Hi Ben, Try doing SHOW ENGINES; and see what it says. It should say InnoDB is supported, if not then it hasn't compiled in. Regards --- ** _/ ** David Logan *** _/ *** ITO Delivery Specialist -

InnoDB problems under 5.1.9

2006-05-23 Thread Ben Clewett
Dear MySQL, I've installed 5.1.9 from source on a SUSE 10 box. But I can't get InnoDB tables respected. I have used the correct compilation flag (--with-innodb). SHOW VARIABLES; lists all the usual innodb variables. The innodb table space has been created in ~/var/ibdata1. But if I enter: C