SQL能不能两表分组显示 大类表:bigsort小类表:smallsort 关联:bigsort_id我想作为这样显示:大类A小类aa小类ab大类B小类ba小类bb小类bc能用SQL解决吗 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select bigsort_id from bigsort unionselect bigsort_id from smallsort--select name from bigsort unionselect name from smallsort begin transelect bigsort_id AS A1,bigsort_id AS B1 into #temp1from bigsort insert into #temp1select b.[小类的ID],A.bigsort+'1'from bigsort AS A,smallsort AS BWHERE A.bigsort_id = B.bigsort_idSELECT A1FROM #temp1ORDER BY B1 datepart在这个存储过程的意思是什么 中学招生数据统计问题 SQL Profiler的分的分类查询 sql存储过程 用C#开发PDA移动设备,如何直接连接SQL Server 2005 数据库? 怎样同步添加记录? 关于这个问题很头痛 sql server中错误处理 smalldatetime字段中只存储时间 头痛死了,怎样对ORACLE中的BLOB字段进行操作? 菜鸟问题:求教一条SQL语句的含义 在sql server里如何将每个月按30天计算
select bigsort_id from bigsort
union
select bigsort_id from smallsort
--
select name from bigsort
union
select name from smallsort
select bigsort_id AS A1,bigsort_id AS B1 into #temp1
from bigsort
insert into #temp1
select b.[小类的ID],A.bigsort+'1'
from bigsort AS A,smallsort AS B
WHERE A.bigsort_id = B.bigsort_idSELECT A1
FROM #temp1
ORDER BY B1