随笔分类 - SQL
摘要:一列变三列的例子: select max(case rownumber % 3 when 2 then id else null end) as id1, max(case rownumber % 3 when 2 then [text] else null end) as text1, max(case rownumber % 3 when 1 then id else null end) a...
阅读全文
摘要:SQL默認用單引號(')做為字符串的標識符 Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->SET QUOTED_IDENTIFIER OFF 則改成雙引號(")作為字符串標識符
阅读全文
摘要:Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->declare @Conditions varchar(10)set @Conditions=''select * from TabelA where ((@Conditions'' AND colN...
阅读全文
摘要:Product(pid,name,amount,nowAmount):标识,名称,已有数量,当前数量 Trade(id,pid,operType,number):标识,产品标识,操作类型(入库:1,出库:0),数量 Product表中测试数据: 1 苹果 100 0 ...
阅读全文
摘要:通常语法: EXECUTE [@return_value=]存储过程名 [[参数名(@Name)=],[参数名(@Name)=]....] 其中:中不能包含函数 例: Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ -->execute proce...
阅读全文

浙公网安备 33010602011771号