Re: A Simple Query Help

2012-04-22 Thread Igor Shevtsov
Hi Rafael, You can try using correlated subquery instead of outer join. This can be slow with big tables though: SELECT * FROM users WHERE accept_email = 1 and email not in (SELECT email FROM sent_emails WHERE sent_emails .email = users.email AND messageID NOT LIKE = ‘XX’) OR OUTER JOIN as

A Simple Query Help

2012-04-22 Thread Rafael Ribeiro
Dear Friends, I m new on this list, and I m trying to learn more about mysql. After perform a lot of searchs in the Internet, I have no answer to my question and would like to ask your help. I wanna a perform a query that depends of the result from another (query) table inside the same

Re: Simple query help

2003-08-30 Thread Roger Baklund
* Boris Villazon > El vie, 29-08-2003 a las 22:05, Daniel Clark escribió: > > > select value from tableName where date in (select max(date) > > > from tableName where id = 4); > > > > > > But, it doesn't work with mysql 4.0. > > > > > > Any ideas? Does anybody had this problem before? > > > > What

Re: Re: Simple query help

2003-08-30 Thread Boris Villazon
El vie, 29-08-2003 a las 22:05, Daniel Clark escribió: > > select value from tableName where date in (select max(date) from > > tableName where id = 4); > > > > But, it doesn't work with mysql 4.0. > > > > Any ideas? Does anybody had this problem before? > > What about: > > SELECT value, date > FR

Re: Simple query help

2003-08-29 Thread Daniel Clark
> select value from tableName where date in (select max(date) from > tableName where id = 4); > > But, it doesn't work with mysql 4.0. > > Any ideas? Does anybody had this problem before? What about: SELECT value, date FROM tablename WHERE id = 4 ORDER BY date ASC Just pick the first row.

Simple query help

2003-08-29 Thread Boris Villazon
Hi I have a "little" problem with my sql skills. I have a table with the following fields: id (int) | value (varchar) | date (date) I need to show for a given id the value of the oldest date. Normally, I'd do something like this: select value from tableName where date in (select max(date)