SQL常用
--1.创建schema
create
schema
exp
--2.把dbo下面的对象e_A,移到exp下面
alter
schema
exp transfer dbo.e_A
--3分组字符串拼接
select id, [values]=stuff((select ','+[value] from tb t where id=tb.id for xml path('')), 1, 1, '')
from tb
group by id
--4 分页( For 2012 this is simpler)
SELECT *
FROM Journals
ORDER BY Journals.JournalId
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY