I hope your database understands the join syntax:

SELECT
         Items.ItemID,
         Items.Name,
         Items.LastModified,
         Viewed.UserID,
         Viewed.LastViewedDate
FROM
         Items LEFT OUTER JOIN Viewed
                ON (Items.ItemID = Viewed.ItemID
                 AND Viewed.UserID = 1)
WHERE
         Viewed.LastViewedDate < Items.ItemLastModified
         OR
         Viewed.LastViewedDate IS NULL
ORDER BY
         Items.ItemID

Jochem

______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to