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~
相关问答:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jas ......
CREATE DATABASE ADDRESSLIST;
USE ADDRESSLIST;
DROP TABLE IF EXISTS FRIEND;
CREATE TABLE FRIEND
(FRIEND_ID INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY ,
FRIEND_NAME VARCHAR(20) NOT N ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
请教高手:
以下是数据库中的三条记录,英文为字段名称
id planname TaskBeginTime Status
329 2010年03 ......