sql语句 查询 - 其他数据库开发 / MySQL/Postgresql
SQL code:
select count(subid) as subnum,st.id,t.title,t.content from subtopics st JOIN topics t ON st.id=t.id
where st.id in (select id from topics where viewid='1')
group by st.id
我的链接条件 为t.id=st.id 但t.id对应的st.id有可能没没有 但我想显示t 表 的内容 SQL语句怎么写
select count(subid) as subnum,t.* from subtopics st right outer JOIN topics t ON t.id=st.id
where t.id in (select id from topics where viewid='1')
group by t.id
order by date desc
我也试出来了 还是谢谢大家 O(∩_∩)O~
相关问答:
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......
各位兄弟请教 下,在mysql中能不能实现这样一个功能,
一个字段A是储存一大段文字内容的,是英文,能不能通过MYSQL的查询之类的功能,来获得这个字段中 出现频率最高的十个单词,并将这十个单词做为新的字段储存
a ......
String sqlCount="select count(*) from usertable where username='"+
userName+"'";这句话 什么意思啊!
这句话输出出来就是
select count(*) from usertable where username='你的变量 ......
我想查询出每天数据的最大的一个值。表的格式如下
表名: hisdata
字段 编号 值 状态 时间
Id value state dattime
101 32.3 0 ......