SELECT c.* from chart as c,grel as gr where (c.id not in(710,722,723) and c.id=gr.tgtId and gr.srcId = 837 and gr.srcType=1 and gr.tgtType=4);SELECT * from chart as c where c.id in(710,722,723);怎么用or变成一条语句啊,求大神
解决方案 »
- mysql 批量插入问题
- mysql如何导入大的.sql文件??
- mysql 触发器支持定时触发吗
- *****Mysql同步问题*****急在线等
- 我第一次来提问哦,希望各位帮帮忙,谁能帮帮我,告诉我C#和JSP如何连接mysql?谢谢了
- insert ...select大数据量如何提高性能
- MySQL Query Browser 配置中 Schema 填什么啊?我是新手
- 请问mysql支持的最长的sql语句能有多少字符?
- 在mysql下使用DECODE
- mysql case when 根据条件得出结果
- pgAdmin 1.8或者pgAdmin1.4 报错
- mysql运行时报错,“Can't open the mysql.plugin table”
where c.id=gr.tgtid and gr.srcid=837 and gr.srcType=1 and gr.tgtType=4
and c.id not in(710,722,723)or c.id in(710,722,723);
where c.id=gr.tgtid and gr.srcid=837 and gr.srcType=1 and gr.tgtType=4
and (c.id not in(710,722,723)or c.id in(710,722,723));
SELECT c.*
FROM chart AS c,grel AS gr
WHERE (c.id NOT IN(710,722,723) AND c.id=gr.tgtId AND gr.srcId = 837 AND gr.srcType=1 AND gr.tgtType=4)
UNION ALL
SELECT * FROM chart AS c WHERE c.id IN(710,722,723);
FROM chart AS c,grel AS gr
WHERE (c.id NOT IN(710,722,723) AND c.id=gr.tgtId AND gr.srcId = 837 AND gr.srcType=1 AND gr.tgtType=4)
OR (c.id IN(710,722,723) AND gr.主键=任意一个grel表的主键);
c.id in(710,722,723);
orSELECT c.* from chart as c,grel as gr where
c.id in(710,722,723)
or
(c.id not in(710,722,723) and c.id=gr.tgtId and gr.srcId = 837 and gr.srcType=1 and gr.tgtType=4)