upper / db

Data Access Layer (DAL) for PostgreSQL, CockroachDB, MySQL, SQLite and MongoDB with ORM-like features.
https://upper.io/
MIT License
3.53k stars 234 forks source link

exists used count(1) #661

Open wzhsh90 opened 2 years ago

wzhsh90 commented 2 years ago

SELECT count(1) AS _t FROM person_info_t WHERE (id=?) LIMIT 1

why not use

SELECT 1 AS _t FROM person_info_t WHERE (id=?) LIMIT 1