简体   繁体   English

如何为 SQL 中缺失的日期和时间的所有列添加空值

[英]How to add null values for all columns for missing dates and time in SQL

I have a table with user name, dates, time of day and value associated for every hour.我有一个表,其中包含每小时关联的用户名、日期、时间和值。 I want to add missing dates for each user for all times of the day with null valued for values.我想在一天中的所有时间为每个用户添加缺失的日期,值为空值。

when u created the set it null当你创建集合时它为空

create table tablename
(
 colname as datetime null
)

this will set bydefault its value to null这将默认将其值设置为 null

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM