在线等 sql 字段查询问题 有点麻烦

rimguncheng 2008-08-08 01:54:35
数据库里面有,id ,code,style_code,del_yn

我想要做的条件是, :
code = shanghai style_code = online_news style_code = news code = shanghai_main del_yn = n(这个是表示已删除的意思)

就是说, 原来的写字板里面, 是 code = shanghai style_code = onlide_news 但现在要把新闻里的, style_code =news code = shanghai_main 的东西一起拿过来 这都是一个标里的,

那我该怎么写 sql 语句阿
...全文
83 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
rimguncheng 2008-08-08
  • 打赏
  • 举报
回复
谢谢大家,
I_hui 2008-08-08
  • 打赏
  • 举报
回复
晕倒 看了半天也不知道楼主说的是什么
连个标点符号也省,看了半天都不知道什么意思。。。
rimguncheng 2008-08-08
  • 打赏
  • 举报
回复
好啦,
PenleyWang 2008-08-08
  • 打赏
  • 举报
回复

select id ,code,style_code,del_yn
from table
where del_yn = 'n' and ((code = 'shanghai' and style_code = 'online_news') or (style_code = 'news' and code = 'shanghai_main'))
sy_binbin 2008-08-08
  • 打赏
  • 举报
回复
select id ,code,style_code,del_yn from table where (code = 'shanghai' and style_code = 'online_news') or (style_code = 'news' and code = 'shanghai_main' and del_yn = 'n' )
  • 打赏
  • 举报
回复
。。。。。

不就是一个简单的where语句吗???
rimguncheng 2008-08-08
  • 打赏
  • 举报
回复
对但是del_yn 是n 德也出来
sxzkf 2008-08-08
  • 打赏
  • 举报
回复
我不明白是什么意思,按我的理解写一个:
select id ,code,style_code,del_yn from table where (code = 'shanghai' and style_code = 'online_news') or (style_code = 'news' and code = 'shanghai_main') and del_yn = 'n'
不知道理解的对不对?
sy_binbin 2008-08-08
  • 打赏
  • 举报
回复
没明白

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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