1、count(1)报错
- <query name="getRecordCountById">
- select count(1) as recordCount from Km c
- where c.id=:id
- </query>
<query name="getRecordCountById"> select count(1) as recordCount from Km c where c.id=:id </query>
2、count(c.*)报错
- <query name="getRecordCountById">
- select count(c.*) as recordCount from Km c
- where c.id=:id
- </query>
<query name="getRecordCountById"> select count(c.*) as recordCount from Km c where c.id=:id </query>
3、count(*)正确
- <query name="getRecordCountById">
- select count(*) as recordCount from Km c
- where c.id=:id
- </query>
