计算SQL Server中每行的记录数

发布于 2025-01-08 20:57:51 字数 1432 浏览 3 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

蓬勃野心 2025-01-15 20:57:51

我的回答是基于您的评论:

哎呀!!!我非常抱歉把事情弄得一团糟..:( 我想要的
说在最后一列有些行有空值,有些行有空值
有一个不必要的值..所以我想做删除
那些最后一列没有空值的行,然后删除
整个最后一栏..

如下:

Delete from dbo.YourTable Where Last_Column IS NOT NULL

之后,如果您右键单击表格 -> ,则可以轻松删除该列。设计
如果由于错误而不允许您删除该列,您应该执行以下操作:
工具->选项->设计师->取消选中“防止保存需要重新创建表的更改”,

但我建议您在完成后撤消该更改。

祝你好运=)

My answer is based on your comment:

Oopss!!! i am extremely sorry fr making a mess..:( what i wanted to
say that at the last column some rows have null values and some rows
have a value which is not necessary.. So what i wanted to do to delete
those rows which have not null values in last column and then deleting
the whole last column..

Here it is:

Delete from dbo.YourTable Where Last_Column IS NOT NULL

After that, dropping the column is easy if you go to table right click -> design
If it doesn't let you drop the column due to an error, you should do this:
Tools -> Options -> Designers-> Uncheck "Prevent saving changes that require table re-creation"

I'd suggest that you undo that change after you're done though.

Best of luck =)

丘比特射中我 2025-01-15 20:57:51

您尝试做的事情不会起作用,因为它们都具有相同数量的列。

因此,不要浪费时间尝试实现它,因为它无法解决您想要解决的任何问题!

What you're trying to do won't work because they'll all have the same number of columns.

So don't waste your time trying to implement it because it won't solve whatever problem you're trying to solve!

才能让你更想念 2025-01-15 20:57:51
DELETE dbo.table WHERE Col4 IS NOT NULL;
DELETE dbo.table WHERE Col4 IS NOT NULL;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文