访问:要查询查询的参数,然后运行它

编程入门 行业动态 更新时间:2024-10-27 06:22:45
本文介绍了访问:要查询查询的参数,然后运行它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我不确定我的问题有多清楚。 我有一张满是查询的表我正在运行agaianst另一张满是记录的表。 考虑我在表格中有一个查询,例如select * from table f< (a + b)/ d 这里假设d的值为0然后会发生错误我想修改它,如果d = 0那么控制必须转到下一个方法。 除了错误捕获之外还有其他任何方法。我的意思是通过修改查询 谢谢

Hi, I am not sure how clear i can be in my question. I have a table full of queries which i am running agaianst another table full of records. consider i have a query in table like select * from table where f < (a+b)/d here suppose value of d is 0 then an error will occur i want to modify it such that if d = 0 then control must move on to next method. is there any way other than error trapping. i mean by modifying the query thanks

推荐答案

有点模糊一些细节。如果''d''是查询中的字段,那么您可以使用WHERE子句过滤那些= 0的字段。 ''我正在运行一堆查询''或者很难解读。您是从代码运行这些查询还是这些都是有效的?如果使用WHERE子句不可行,则可能在代码中执行某种If ... Then ... Else或Select Case语句以跳过无效记录。 Kinda fuzzy on some details there. If ''d'' is a field from a query, then you could just filter those that =0 with a WHERE clause. ''I''m running a bunch of queries'' or whatnot is hard to decipher. Are you running these queries from code or how is this all working? It is probably possible to do some sort of If...Then...Else or Select Case statement in the code to skip invalid records if using a WHERE clause is not viable.

well d是表格中的一个字段。 代码有以下声明 select * from table 语句的stillig部分位于一个以循环形式执行的表中。 表中的一个条件是f<(a + b)/ d 返回erro,因为d可能在某些记录中返回0 i不能更改代码,因为其他条件可能会受到影响然后代码不是通用的,因为d可能不是所有表的一部分 i想要在这种情况下进行更改f<(a + b)/ d well d is a field from a table. the code has the following statement select * from table where the remainig part of the statement are in a table which is executed in the form of a loop. one of the condition in the table is f<(a+b)/d which is returning erro because d might return 0 in some records i cant change code as ther are other conditions which might get affected and then code will not be generic, as d may not be a part of all tables i want to make change in this condition f<(a+b)/d

的 @atksamy Dunno。我想我建议你根据你的循环查询来选择已经过滤掉d = 0的任何记录的查询。 更像是: SELECT * FROM(SELECT * FROM table WHERE d<> 0)AS Temp WHERE 或类似的东西。 祝您好运。 @atksamy Dunno. I guess I suggest that you base your loop query to select from a query that has already filtered out any records where d = 0. So more like: SELECT * FROM (SELECT * FROM table WHERE d <> 0) AS Temp WHERE or something of that nature. Good luck to you.

更多推荐

访问:要查询查询的参数,然后运行它

本文发布于:2023-10-27 02:44:01,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1532072.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:参数

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!