sql help

    Date: 03/29/05 (MySQL Communtiy)    Keywords: database, sql

    Okay, I don't know how to form this SQL statement... I'm so not a database person, I always knew it.

    I've got three tables: users, questions, and answers. Each user can answer a question only once, but each question has lots of different answers, each by different users.

    What I want to do is let a user search for questions that he has not answered. I know how to do the search for questions he has answered, it's just one neat SQL statement that links all the tables together (user id matches userid in answer table, which also has a question id which matches the question id in the question table) but I don't know how to go the other way. I need to list all the questions for which no answer (with this user's user ID) exists.

    Source: http://www.livejournal.com/community/mysql/52672.html

« recurrent question || SELECT across multiple tables? »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home