sql中的类型转换和拼接sql
来源:互联网 发布:净网行动知乎 编辑:程序博客网 时间:2024/05/21 09:33
今天在工作中被一个知识点难住了,就是写sql语句,分支语句个sql中的类型转换。哎很简单的知识点哎,憋了一下午 ,收获就是sql语句也是可以断定调试的,还可以单独的将句子摘出来执行下,看看运行结果
--declare @CatayCode varchar(50)
--set @CatayCode=( select CatayCode from item where id=9)
insert into item values (0,119,'美丽护肤3')
declare @count int ,@CatayCode varchar(50)
set @count =(select COUNT(CatayCode) from item where ParentId=20)if @count=0
begin
set @CatayCode=( select CatayCode from item where id=20)+'001'
end
else
begin
set @CatayCode= (select MAX (cast(right(CatayCode,6) as int)) from item where ParentId=20)+1
end
insert into item values (20,@CatayCode,'我爱你啊')
select * from item
select MAX (cast(right(CatayCode,6) as int)) from item where ParentId=9
select MAX (id) from item where ParentId=9
0 0
- sql中的类型转换和拼接sql
- sql中的类型转换---学习
- Sql 变量和类型转换
- 实现在sql中的类型转换
- sql中的字段、字符串拼接
- SQL 多字段拼接 和 列拼接
- sql类型转换函数cast和convert
- sql类型转换和精度控制
- SQL数字类型转换和四舍五入
- sql类型转换
- sql 类型转换
- SQL 时间类型转换
- sql语句 类型转换
- postgre sql 类型转换
- Sql Cast 类型转换
- sql类型转换
- 拼接sql
- SQL 拼接
- uvaoj 673 Parentheses Balance
- Leetcode:Reverse Linked List II 单链表区间范围内逆置
- java android 最全的电话号码检测
- 程序员永远的痛之字符编码的奥秘
- 如何不被程序员(RD)们嫌弃--写给那些血气方刚的产品经理(PM)
- sql中的类型转换和拼接sql
- Everythis is store书载(2)
- iOS_study_fourth
- CSS中的position
- Context initialization failed
- Unity3d 4.3.4f1运行项目
- 今天学习的内容dom4j编程、debug调试、JDK5.0新特性
- java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.gditc.mmms/com.gditc.mm
- 为什么要有标题啊