Giovanna Pavarani <[EMAIL PROTECTED]> wrote: > i'm sorry if this kind of question was already posted, i'm a newbie and > i hope you will find anyway the time to answer me. > > I've installed mysql version 4.0.12-nt on my Windows XP Professional > notebook and mysql version 4.0.12-standard on a Solaris 8 machine. > > Some antefacts: > I need a very very small database to keep track of a set of discussion > topics, a set of users and the subscriptions of the users to the > discussion topics. > > This is my database (a poor designed one, i know): >
[skip] > > what i'd need is to present the user a list of the topics that he's not > yet subscribed. > I read the MySQL manual and I found that NOT IN and the nested SELECTs > are not supported in this version, so I ended up to use temporary tables. > > These are the queries that i use: > > CREATE TEMPORARY TABLE user03 (TopicName varchar(40)); > INSERT INTO user03 SELECT TopicName FROM subscriptions WHERE > SipUri='[EMAIL PROTECTED]'; > SELECT topics.TopicName FROM topics,user03 WHERE topics.TopicName != > user03.TopicName; It's not correct query, because it gives you cartesian product of not equal TopicName. As to query with NOT IN you can rewrite it with LEFT JOIN as described at: http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html > > They are working fine on XP, the result is the list of topics at which > user03 isn't subscribed yet. But on Solaris, with the same database, the > result is a list of all the topics, repeated a certain number of times. > > > I'm stucked on this, is it possible that the problem is the > 4.0.12-standard version? Should I use the 4.0.12-max version? Or am i > missing something? -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Victoria Reznichenko / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]