Mysql::Error: Subquery returns more than 1 row:
问题 In my rails app, I am running a sql query using find_by_sql() since I need subqueries. This works if I do either the first or second query but when I add them together with the AND, it starts complaining about more than 1 row in subquery. I want all rows (records) returned that match the criteria. What needs to be fixed/changes here? What is telling mysql I only want 1 row? Here is the resultant SQL as viewed in the rails log: Mysql::Error: Subquery returns more than 1 row: select p.* from