先加一新字段再赋值:
alter table table_name add mmm varchar2(10)
update table_name set mmm=**
或:
alter table table1 add col1 int default 0
CASE WHEN account_id= ''
THEN 'empty'
when account_id is null
then 'empty'
ELSE account_id
END
WHERE account_id = 'XXX' OR account_id ='' OR (account_id is NULL)[/code]
扩展资料:
SQL有两种使用方式。一是联机交互使用,这种方式下的SQL实际上是作为自含型语言使用的。另一种方式是嵌入到某种高级程序设计语言(如C语言等)中去使用。前一种方式适合于非计算机专业人员使用,后一种方式适合于专业计算机人员使用。尽管使用方式不向,但所用语言的语法结构基本上是一致的。
参考资料来源:百度百科-结构化查询语言
应该这样写吧,没测试select a.SourceID,c.Name,a.Value as Value1,b.Value as Value2
from
(
select SourceID,Value from DataLog2 where TimestampUTC=@开始时间 and QuantityID=129
) as a
full join
(
select SourceID,Value from DataLog2 where TimestampUTC=@结束时间 and QuantityID=129
) as b
on a.SourceID=b.SourceID
inner join
Source c
on a.SourceID=c.ID
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)