第一块 我们学了excel到数据库思维的转化。
第二块 讲整合。
2.1、变量声明、

第一个技能,我们学习变量的声明,赋值。
我们直接在数据库中,学习变量的声明。
2.1、变量声明、

同时选中后执行,可以select 得到数据
我们可以先声明变量,之后对变量赋值
然后在 sql中 直接使用变量。
–声明变量
–declare @名称 + 数据类型
DECLARE @name VARCHAR(50)
DECLARE @nameid INT
DECLARE @namemoney MONEY

–set 变量名 = 值
SET @name = ‘FocusBI’
SET @nameid = 1
SET @namemoney = 1.01

–使用
SELECT @name as 名字, @nameid as id号, @namemoney as 金额

2.1、变量声明、

declare @num int
set @num = 1

while @num <= 5
begin
select @num * @num
set @num = @num + 1
end
2.1、变量声明、

相关文章:

  • 2022-02-05
  • 2022-03-09
  • 2021-11-13
  • 2021-07-21
  • 2021-06-23
  • 2021-09-23
  • 2021-11-08
  • 2021-10-20
猜你喜欢
  • 2022-03-10
  • 2022-03-07
  • 2021-12-08
  • 2021-11-18
  • 2021-07-15
  • 2021-04-27
  • 2022-02-21
相关资源
相似解决方案