读书人

哪位高手会写此sql语句

发布时间: 2012-01-24 23:11:54 作者: rapoo

谁会写此sql语句?
et_channel[新闻频道表] et_news[新闻内容]

pk channel_id[频道编号] mews_id[新闻编号]
title[标题]
channel_fid[父频道编号] title2[副标题]
title [频道标题] mark[标识]
mark[频道标识] keyword[关键字]
memo[备注] summary[简介]
status[状态] content[内容]
createtime[创建时间] other_url[其他连接]
channel_order{排序} editor[作者]
channel_image[频道图片]



需求: 取当前频道的新闻编号列表

[解决办法]

SQL code
;with cte as(select channel_id,news_id,channel_fid from et_channelunion allselect b.channel_id,b.news_id,b.channel_fid from cte a inner join et_channel b on a.channel_fid=b.channel_id)select news_id from cte
[解决办法]
没看明白这俩表要怎么关联

读书人网 >SQL Server

热点推荐