On Mon, 19 Jul 2010 10:36:40 -0600
"Ashley M. Kirchner" <ash...@pcraft.com> wrote:


> mysql> select * from table where id='00001';
> +-------+-----+-----+---+
> | 00001 | 123 | 0.0 | C |
> | 00001 | 234 | 0.1 | D |
> | 00001 | 345 | 0.0 | D |
> | 00001 | 456 | 0.1 | C |
> | 00001 | 567 | 0.1 | G |
> +-------+-----+-----+---+
> 
>      Now, I have to find other IDs that match the above result.  In the 
> table, that would be ID '00003' (and in the entire DB, there may be 
> others as well - I need to find all those IDs.)  But, notice how ID 0003 
> isn't in the same order as ID 00001, but the data is still the same.
> 
select distinct id from `table` where concat(`b`, `c`, `d`) in (select 
concat(`b`,`c`,`d` from `table` where id = '0001') AND id != '0001';
(untested)

-- 
Simcha Younger <sim...@syounger.com>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to