You might do something like:

SELECT t1.* FROM t1 LEFT JOIN t2 ON(t1.field1=t2.field1 AND field2={fieldvalue}) WHERE 
{all kinds of limits} AND t2.field1 IS NULL LIMIT 0,20;

the LEFT JOIN/WHERE idfield IS NULL will join the table and then lists rows in table 1 that don't exist in table 2

Mark van Beek wrote:

Hi,



For a project I'm creating a search function, the deal is this, a select
query must be submitted and in this query a check must be done to confirm a
previously found and accepted item is not shown anymore, a short version of
the query I need is this:



SELECT * FROM t1 WHERE {all kinds of limits} AND 0 = (SELECT count(*) FROM
t2 WHERE field1=t1.field1 AND field2={fieldvalue}) LIMIT 0,20;



I don't know if the above query gives the result I want for starters, but if
someone gets the idea and know a way to implement a query like this in mysql
3 instead of mysql 4.1+ I'd like to know. I cannot just upgrade to mysql
4.1+ since the database is on a rented server and I'm just the geek trying
to fix some things on the site.



Greetings Mark








--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to