关于SQL语句的问题。急!!!

来源:百度知道 编辑:UC知道 时间:2024/09/21 08:58:43
create table aaa( nnn int);
insert into aaa values ('1111');
insert into aaa values (2222);
这两个添加数据的语句都能执行,这两句话有什么区别吗?
定义的int型的变量,为什么能添加CString类型的数据啊?
那 int 是用来干什么的啊?
在查找的时候 select * from aaa where nnn = '1111';
和 select * from aaa where nnn = 1111;为什么都行啊?
回答了这个问题,马上给分。

我就是在问这个问题,可是我这样写select * from aaa where nnn = 1111;可以查到,所以才问的。能不能回答的详细一点啊。

不过先把分给了你啊!谢谢

1.创建数据库 aaa
2.将字符串1111插入数据库aaa
3.将2222插入数据库aaa
那个int不是用来限制插入的数据类型

得把‘1111’改为1111才可以
不然select * from aaa where nnn = 1111查找不到,
插入‘1111’会类型出错

自动转换了已经