// 创建视图 data.createOrReplaceTempView("Affairs") val df1 = spark.sql("SELECT * FROM Affairs WHERE age BETWEEN 20 AND 25") df1: org.apache.spark.sql.DataFrame = [affairs: double, gender: string ... 7 more fields] // 子查询 val df2 = spark.s…
--删除所有约束.表.视图等SQL脚本 --############################################### --删除所有外键约束 --############################################### DECLARE @SQL VARCHAR(99) DECLARE CUR_CONSTRAINT CURSOR LOCAL FOR SELECT 'ALTER TABLE '+ CASE WHEN O.schema_id IS NOT NU…
语法: alter view dbo.视图名 as 更新后的视图SQL go 举个栗子: 原视图名为YOUR_VIEW其中SQL为: select * form TableA 更新视图: alter view dbo.YOUR_VIEW_NAME as select * from TableB go…