![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
sql
ljz520lx
这个作者很懒,什么都没留下…
展开
-
sql server 2008 自带导出表数据功能
右击需要导出的数据库->Tasks->Generate Scripts..->next->找到talbe/view options下的script data 默认为false 改为true ->后面的就明白了原创 2011-05-13 17:46:14 · 93 阅读 · 0 评论 -
根据不同的条件进行升序或降序排列(order by )
当@status为2时 我需要对 createDate 字段进行升序排序 当@status为3时 我需要对 createDate 字段进行降序排序 [code="java"] select *from 表名 a order by (case when @status=2 then createdate when @status=3 then GETDATE()-createda...原创 2011-08-31 17:07:48 · 1943 阅读 · 0 评论 -
sql grouping用法
示例代码如下: [code="java"] DECLARE @t TABLE(Groups char(2),Item varchar(10),Color varchar(10),Quantity int) INSERT @t SELECT 'aa','Table','Blue', 124 UNION ALL SELECT 'bb','Table','Red', -23 UNION AL...原创 2011-09-07 12:05:02 · 192 阅读 · 0 评论 -
sql 财务科目余额表写法
[code="java"] -->生成测试数据 declare @科目表 table([科目ID] int,[科目编码] nvarchar(10),[科目名称] nvarchar(5)) Insert @科目表 select 1,N'1001',N'现金' union all select 2,N'1002',N'银行存款' union all selec...原创 2012-05-30 11:01:42 · 1684 阅读 · 0 评论 -
SQL 按ascii码排序
[code="java"] select * from 表名 order by 字段名 COLLATE Albanian_BIN [/code]原创 2012-06-19 13:51:53 · 1502 阅读 · 0 评论