以下查询在MySQL (rails生成的)中运行良好: sum(up_votes) total_up_votes "answers" "answersERROR: column "answers.id" must appear in the GROUP BY clause or be used in an aggregate functionclass User
我在获取基本上为空值的数据库字段值时遇到问题SELECT * FROM table WHERE field=''; //this means null in phpSELECT * FROMtable WHERE field IS NULL; //this means null in mysql db
这两个查询产生不同的结果。