首页 \ 问答 \ 内联表值函数(Inline table valued function)

内联表值函数(Inline table valued function)

我需要创建一个表函数,在第1列中生成一个指定数字的参数,始终从1开始。在第2列中,如果第1列可以被5整除,则会说'Div5',否则为NULL

以此为例。 我指定第1列将在5处停止,最终结果将如下所示;

1 NULL

2 NULL

3 NULL

4 NULL

5 Div5

我可以创建函数,但我不知道如何创建条件第一列,或者如何说第2列除以5是一个整数然后'Div5'如果它是小数然后是NULL;

create function MyFunction ()

Returns @Division Table 

(Ind int , 
Div5 varchar(30))

AS
begin
Insert Into @Division (Ind, Div5)

select ???,???

Return;
End;

我希望这能给出足够的细节吗?

谢谢 :)


I need to create a table function that produces a parameter up to a specified number in column 1 always starting from 1. In column 2, if column 1 is divisible by 5 it will say 'Div5' otherwise NULL.

So as an example. I specify column 1 will stop at 5 the end result will look as follows;

1 NULL

2 NULL

3 NULL

4 NULL

5 Div5

I can create the function, but I'm not sure how to create the conditional first column, or how to say if column 2 divided by 5 is an integer then 'Div5' if it's a decimal then NULL;

create function MyFunction ()

Returns @Division Table 

(Ind int , 
Div5 varchar(30))

AS
begin
Insert Into @Division (Ind, Div5)

select ???,???

Return;
End;

I hope this gives enough detail?

Thank you :)


原文:https://stackoverflow.com/questions/35367614
更新时间:2023-06-09 22:06

最满意答案

您必须从Google Project控制台中打开防火墙端口8080。 请参阅此链接: https//console.cloud.google.com/networking/firewalls/list?project = [yourproject-id] 。 将your-project-id替换为Google Project的ID


You have to open the firewall port 8080 from your Google Project console. See this link: https://console.cloud.google.com/networking/firewalls/list?project=[your-project-id]. Replace your-project-id with the id of your Google Project

相关问答

更多
  • 可能你已经安装了LAMP。 检查是否安装了Apche: dpkg --get-selections | grep -v deinstal | grep apache 你可能会得到这个: apache2 install apache2-bin install apache2-data install apache2-mpm-prefork install apache2-mpm-worker ...
  • 聊天中的讨论和调查显示,这实际上是关于远程系统,而不是本地开发设置。 这意味着通常一个包过滤器(“防火墙”)位于客户端和服务器之间。 当使用非标准端口作为“众所周知的协议”时,您需要在服务器防火墙中打开该端口以获取传入流量。 在这种情况下,使用Ubuntu的ufw工具来设置一个简单的包过滤器。 配置自定义端口82并允许传入流量来解决问题。 The discussion and investigation in the chat revealed that this actually was about a ...
  • 所以它抛出了这个错误消息,因为你有apache2在端口80上运行。 如果这是为了开发,我只要离开它在5000端口。 如果是生产,也可以: 不建议 先停止apache2 ; 不推荐,因为它在文档中说明: 您可以在开发过程中使用内置服务器,但应为生产应用程序使用完整的部署选项。 (生产中不要使用内置开发服务器) 推荐的 将HTTP流量通过apache2代理到Flask。 这样, apache2可以处理您所有的静态文件(它非常好 - 比Flask内置的调试服务器更好),并且作为动态内容的反向代理,将这些请求传递给 ...
  • 我建议在8080上将Noir作为非root用户运行,并使用规则将该域和端口转发到在80上运行的Apache。是否还有另一个原因,您不想这么做? I would recommend running Noir as a non-root user on 8080 and using a rule to forward that domain and port to your Apache running on 80. Is there another reason you don't want to do th ...
  • 您必须从Google Project控制台中打开防火墙端口8080。 请参阅此链接: https : //console.cloud.google.com/networking/firewalls/list?project = [yourproject-id] 。 将your-project-id替换为Google Project的ID You have to open the firewall port 8080 from your Google Project console. See this lin ...
  • 想通了 - 我使用Google云端平台,他们阻止端口1337,我只需要通过它手动允许TCP。 如果你想知道,命令是 gcloud compute firewall-rules create allow-port-1337 --allow tcp:1337 --description="Allow port 1337 to be accessed" Figured it out -- I was using Google Cloud Platform and they blocked port 1337, ...
  • 解决了。 我有一个新的路由器,这个需要你设置虚拟服务器的设置。 那是不是很有效。 我的ISP甚至没有阻止端口80.一切都与路由器有关。 Solved. I have a new router and this one need you to set up settings for a Virtual Server. Did that and everyting worked. My ISP didnt even block port 80. Everything had to do with the rou ...
  • 如果您在不关闭服务器的情况下删除了包,请执行: sudo killall -9 httpd 如果仍然没有杀死它,请通过执行以下操作来查看实际使用端口80的内容: netstat -anp | grep LISTEN | grep 80 找出服务器是什么,使用端口80并停止/杀死它。 If you've removed the package without shutting down the server first, execute: sudo killall -9 httpd If that st ...
  • 我忘了去/etc/apache2/ports.conf并添加Listen 1998然后我在我的虚拟主机中添加了NameVirtualHost *:1998 I forgot to go to /etc/apache2/ports.conf and add Listen 1998 then i added NameVirtualHost *:1998 in my virtualhost
  • 这可能是wordpress配置的问题。 我认为如果您在另一个域中,wordpress使用wordpress地址(网址)或网站地址(网址)进行重定向。 因此,您应将此地址配置为localhost和localhost:8080。 It was a browser issue. Chrome and Firefox were automatically changing the URL to localhost. It works with curl and in Incognito/Private modes. ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)