• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

sql高级操作

mysql 搞代码 4年前 (2022-01-09) 17次浏览 已收录 0个评论

同样也是用于记录以便日后联系用!里面基本包含了一般sql的高级用法! drop table if exists stu;create table stu(name varchar(30),age int,stuid int not null PRIMARY key AUTO_INCREMENT,idnum int,sex varchar(30),check(sex in (‘男’,’女’)))charset=

同样也是用于记录以便日后联系用!里面基本包含了一般sql的高级用法!

drop table if exists stu;create table stu(name varchar(30),age int,stuid int not null PRIMARY key AUTO_INCREMENT,idnum int,sex varchar(30),check(sex in ('男','女')))charset=utf8;insert into stu (name,age,idnum,sex)VALUES('damon',789,4678945,'男');insert into stu (name,age,idnum,sex) VALUES('coco',13,345,'女');inse<mark>来源gaodaimacom搞#^代%!码网</mark>rt into stu (name,age,idnum,sex)values('kitty',13,46,'女');insert into stu (name,age,idnum,sex)values('alice',14,123,'女');SELECT * from stu;select * from stu limit 0,2;select * from stu where name like '%ce';select * from stu where name REGEXP "a[sfdl][^ads]";select * from stu where name in ('damon','alice');select * from stu where name BETWEEN 'coco' and 'kitty'; select * from stu where name not between 'coco' and 'kitty';select name as stuname,stuid as id from stu;drop view if EXISTS young_stu;create view young_stu asselect name,age from stu where age between 10 and 20;select * from young_stu where age is not null;

后面会再记录一章专门使用sql函数。


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:sql高级操作
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址