SELECT with Result Ordered by Minimum of Fields

2006-08-05 Thread David T. Ashley
Hi, I have a table and I'd like to do a SELECT query with the result ordered by the minimum of two fields. I might also like to query by the minimum (but that is an easier problem, as I can just rephrase it as an OR). Can I just write something like: SELECT * FROM mytable WHERE fieldofinterest

Re: Limiting a Join

2006-08-05 Thread Peter Brawley
Michael The subquery version of that logic SELECT * FROM a JOIN b ON a.id = b.a_id WHERE b.id = ( SELECT MAX(c.id) FROM b as c WHERE c.a_id = a.id ); likely runs slower. If the sorting column is also the joining column, you can still write it as a join: SELECT a.*, b.* FROM a INNER JO

Re: stuck on localhost authentication

2006-08-05 Thread Brad Jahnke
> insert into user (user,host) values ('jeff','localhost'); > flush privileges; > grant all on databaseName.* to jeff; jeff = [EMAIL PROTECTED] not [EMAIL PROTECTED] So in your statement you should have used... grant all on databaseName.* to [EMAIL PROTECTED]; >select user,host from

Re: Limiting a Join

2006-08-05 Thread Michael Caplan
Peter, Thanks for the reply. I was not able to get your query working as illustrated. I also realize that my example query was flawed, as I made no reference to an ordering column (as you point out). What I was able to get working is the following: SELECT * FROM a JOIN b ON a.id = b.

MySQL 5.0.24 has been released

2006-08-05 Thread Joerg Bruehe
Hi, MySQL 5.0.24, a new version of the popular Open Source Database Management System, has been released. The Community Edition is now available in source and binary form for a number of platforms from our download pages at http://dev.mysql.com/downloads/ and mirror sites. Note that not

Re: Limiting a Join

2006-08-05 Thread Peter Brawley
Michael, >If I wanted all records from "a" and only the first record from "b", >how would I integrate a LIMIT statement in this, or some other >statement that would achieve the same end? Appending LIMIT >to the end of the query will limit the entire result set, which is not >the desired effect.

stuck on localhost authentication

2006-08-05 Thread Jeff Drew
I'm apologize for posting an apparently simple question, but I'm stuck. I'm trying to get my java application to connect to mysql on the same server. The server is redhat with mysql 5.1.11. I'd done this with mysql 4.x in the distant past. I add a user with the command: insert into user (user

Limiting a Join

2006-08-05 Thread Michael Caplan
Hi there, I'm following up on a thread I started yesterday with a new thread, cause I'm now looking at a different problem: limiting the result of a join. For example: SELECT * FROM a JOIN b ON a.id = b.id If I wanted all records from "a" and only the first record from "b", how wo

MySQL+OpenVPN

2006-08-05 Thread Asif Lodhi
Hi, Can anyone on this list tell me _how_ i can connect to my MySQL-5.0.22 server running on Windows-XP-SP2 using OpenVPN on Windows? It looks like a good VPN/SSL implementation. -- Thanks in advance, Asif -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubs