请问这样的sql怎样实现呀 ?

[复制链接]
查看11 | 回复2 | 2009-5-13 01:10:27 | 显示全部楼层 |阅读模式
这个可以单用子查询实现,不过比较复杂: select result=(str((select sid from student stu where stu.sid=student.sid)) +(select sName from student stu where stu.sid=student.sid)) from student 我用的是自己的表Student我把建这张表的SQL语句写在下面你拷过去也建张表,加点数据,再把上面的查询语句拷过去执行一下看看是不是你要的效果 create table Student ( sid int identity(1,1) primary key, sName varch...
回复

使用道具 举报

千问 | 2009-5-13 01:10:27 | 显示全部楼层
你的no是int还是varchar的int的话转换一下select cast(no as varchar) + '、' + content from 表varchar的话直接用+就可以select no + content from 表...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行