> -----Original Message-----
> From: Mumba Chucks [mailto:[EMAIL PROTECTED]
>
> I've been given a table to work with, and I'm not
> meant to change it:
>
> -------------------------------------
> | TABLE_NAME | TBL_IDX | KEYW_ID |
> -------------------------------------
> | PROPERTIES | 108 | 16 |
> -------------------------------------
> | PROPERTIES | 119 | 16 |
> -------------------------------------
> | PROPERTIES | 108 | 62 |
> -------------------------------------
> | PROPERTIES | 119 | 16 |
> -------------------------------------
> | PROPERTIES | 135 | 16 |
> -------------------------------------
> | PROPERTIES | 135 | 17 |
> -------------------------------------
>
> How do I select out and filter only rows that match
> both 16 and 62 in the KEYW_ID col? IE. The query
> would return only 119 and 108?
I'm sure this could be done more effeciently other ways, possibly with a sub
select if available, but something like this would probably work:
SELECT temp1.*
FROM table_name AS temp1
LEFT JOIN table_name AS temp2
ON temp1.tbl_idx=temp2.tbl_idx
WHERE (temp1.keyw_id=16 AND temp2.keyw_id=62)
OR (temp1.keyw_id=62 AND temp2.keyw_id=16);
- Barry
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]