我可以告诉我的mysql模式,如何写一个查询的最后2x10行,谁1列是真的或假的?
例如,我想接收列'allapot'为true的最后10条记录,并且想接收列'allapop'为false的最后10条记录,并且所有记录都没有重复。
有人能帮忙吗?谢谢.
对不起,我的英语不好。
您可以使用以下查询:
select min(id),your_table.* from your_table
where allapot='TRUE' Limit 10
UNION select min(id), your_table.* from your_table
where allapot='FALSE' Limit 10