2 messages in com.mysql.lists.win32Problem with query
FromSent OnAttachments
Greg Quinn05 Feb 2004 10:19 
Randy Clamons05 Feb 2004 14:23 
Subject:Problem with query
From:Greg Quinn (gr@i-online.co.za)
Date:02/05/2004 10:19:19 AM
List:com.mysql.lists.win32

I am trying to get a list of values in a table where the PARENTID is not in the
ID column...

i.e

Select ID From MailTree WHERE ParentID NOT IN (Select ID From MailTree)

ID is an integer, and ParentID is a DOUBLE with 3 decimal places

I am trying to cast ParentID as an integer, so it can match format with PARENTID
and return the correct results, but it doesn't seem to work...

i.e

Select ID From MailTree WHERE Cast(ParentID as Unsigned) NOT IN (Select ID From
MailTree)

But this doesn't return the required results.

Any ideas?

I am using MySql version 5.

Greg