普通的一条sql运行正常
如:select username from test where username='a';
输入:username
a
在存储过程中username,null
解决:
select a.`username` from test a where a.`username`='a';
SQL查询技巧
本文介绍了一种在SQL查询中使用特定语法来解决问题的方法。通过在表名后加上字段名称并用反引号括起来,可以避免某些情况下出现的问题,例如当字段名为保留字时。
普通的一条sql运行正常
如:select username from test where username='a';
输入:username
a
在存储过程中username,null
解决:
select a.`username` from test a where a.`username`='a';
774

被折叠的 条评论
为什么被折叠?