using AND condition MYsql [duplicate]
问题 This question already has answers here : Find Condition by And doen't work + cakephp (2 answers) Closed 6 years ago . What I need is: when I give training_id 172 AND training_id 174 it have to return user 150 only I tried this but it doen't work SELECT user_id FROM Training_users WHERE training_id = 172 AND training_id = 174 Most of the times training_id might be more than 2 回答1: What about this query: SELECT user_id, COUNT(*) as nbTrainings FROM Training_users WHERE training_id = 172 OR