Mysql取值问题

qq_30635781 2017-09-28 06:03:49
我现在有一个字段,值是15 我想select出除了15以外的1至16的值,请问怎么做,谢谢
...全文
281 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_30635781 2017-09-29
  • 打赏
  • 举报
回复
引用 3 楼 zjcxc 的回复:
无中生有只能造记录
select * from( select @i:=@i+1 as id from information_schema.columns a, information_schema.columns b, (select @i:=0) c limit 16 ) x 
where id not in (select 值字段 from 你的表);
非常感谢,我试试看,感谢
zjcxc 2017-09-29
  • 打赏
  • 举报
回复
无中生有只能造记录
select * from( select @i:=@i+1 as id from information_schema.columns a, information_schema.columns b, (select @i:=0) c limit 16 ) x 
where id not in (select 值字段 from 你的表);
qq_30635781 2017-09-29
  • 打赏
  • 举报
回复
引用 1 楼 zjcxc 的回复:
select ( from 表 where 字段 <> 15
我的意思是我这个字段的值是15,其他1到16都没有,我想怎么做才能把除了15以外的其余数字select出来
zjcxc 2017-09-29
  • 打赏
  • 举报
回复
select ( from 表 where 字段 <> 15

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧