Files
Hui-s-notebook/sql语句.md
2024-05-09 22:58:28 +08:00

10 lines
538 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
小数类型使用 bigdecimal禁止使用 floag 和 double
使用 count (\*)而不是 count (列名)或 count(常量)
超过三个表禁止 join
分页时count 为 0 直接返回,避免后面分页语句
不得使用外键和级联,一切外键在应用层解决
禁止使用存储过程,难以调试和扩展,没有移植性
查询和变更涉及多个表需要在列名前加表名
in 操作尽量避免,避免不了控制在 1000 内
sql 少写逻辑,放到业务层去写
mybatis 动态语句避免导致查询全表