在RabbitMQ主题交换中路由与模式不匹配的消息(Routing messages in RabbitMQ topic exchange that do NOT match a pattern)
使用以下路由密钥将两个队列绑定到主题交换:
队列A,与路由键模式匹配
*.foo
绑定
队列B,与路由键模式匹配*.bar
绑定我想在这个交换中添加第三个队列,它接收既不是
foo
消息也不是bar
消息的消息。 如果我用#routing键绑定这个队列,我自然会得到我需要的所有消息,但包括我不想要的foo
和bar
。任何方式来路由邮件修补模式
NOT *.foo
ANDNOT *.bar
?Two queues are bound to a topic exchange with the following routing keys:
Queue A, bound with routing key pattern match
*.foo
Queue B, bound with routing key pattern match*.bar
I'd like to add a third queue to this exchange that receives messages that are neither
foo
messages norbar
messages. If I bind this queue with a#
routing key, I naturally get all messages I need, but includingfoo
's andbar
's which I don't want.Any way to route messages patching a pattern
NOT *.foo
ANDNOT *.bar
?
原文:https://stackoverflow.com/questions/28351469
最满意答案
它可以通过简单的UPDATE查询来完成:
update sample_table set amount = total_amount * percentage/100;
但是如果你需要PLSQL循环,你可以使用Cursor FOR LOOP:
for x in (select distinct percentage from sample_table) loop update sample_table set AMOUNT = total_amount * x.percentage/100 where percentage = x.percentage; dbms_output.put_line(x.percentage || ': ' || total_amount * x.percentage/100); end loop;
It can be done by the simple UPDATE query:
update sample_table set amount = total_amount * percentage/100;
But if you need PLSQL loops you can use Cursor FOR LOOP :
for x in (select distinct percentage from sample_table) loop update sample_table set AMOUNT = total_amount * x.percentage/100 where percentage = x.percentage; dbms_output.put_line(x.percentage || ': ' || total_amount * x.percentage/100); end loop;
相关问答
更多-
oracle安装客户端工具pl/sql的目的是方便数据库的管理。 mysql也是一样的道理。安装phpMyAdmin或者Navicat,也是方便数据库的管理。
-
PLSQL developer和oracle到底是什么关系啊???[2023-03-26]
PLSQL developer是编写SQL的工具 ORACLE是数据库软件 -
刚刚装好的oracle怎么用PLSQL连接???[2023-11-29]
1、在Oracle的安装目录下找到tnsnames.ora。 2、在这个文件中填写连接数据库的配置信息。 DEMO = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.110)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = DEMO) ) ) -
oracle中的plsql where (+)用SQL如何实现?[2022-05-31]
左外连接用left join,右外连接用right join语句。 比如 Oracle: select * from a, b where a.id=b.id(+) SQL: select * from a left join b on a.id=b.id 反过来a.id(+)=b.id 就是right join -
Hibernate Entity不适用于Eclipse中的Oracle PLSQL(Hibernate Entity doesnt work for Oracle PLSQL in Eclipse)[2022-09-08]
在这种情况下 ORA-00942表或视图不存在 首先要做的事情 检查表是否具有同义词(Oracle表名在系统视图中区分大小写): SELECT * from all_synonyms where table_name='LESSON'; 如果没有,您可以指定表所在的架构,也可以为其创建同义词。 我的架构在哪个表上? SELECT owner from all_tables where table_name='LESSON'; =>这使您可以在其他命令中使用在hibernate ... -
set feedback off 应该压制消息 set feedback off should suppress the message
-
在oracle plsql中循环(looping in oracle plsql)[2024-03-15]
它可以通过简单的UPDATE查询来完成: update sample_table set amount = total_amount * percentage/100; 但是如果你需要PLSQL循环,你可以使用Cursor FOR LOOP: for x in (select distinct percentage from sample_table) loop update sample_table set AMOUNT = total_amount * x.percentage/100 wh ... -
Oracle:带有类的PLSQL(Oracle: PLSQL with classes)[2022-07-17]
你可以使用对象: CREATE OR REPLACE TYPE timer AS OBJECT ( start_time DATE , end_time DATE , CONSTRUCTOR FUNCTION timer RETURN SELF AS RESULT , MEMBER FUNCTION get_duration RETURN NUMBER ) ; / CREATE OR REPLACE TYPE BODY timer IS CONSTRUCTOR FUNCTI ... -
SQL - 结构化查询语言 - 是查询关系数据库的“标准”语言。 大多数(如果不是全部)RDBMS供应商都支持SQL,或者确切地说是他们自己的SQL 版本 。 即使从80年代开始按ANSI标准化,也很少达到100%的合规性。 许多RDBMS接受特定于供应商的SQL扩展。 换句话说,Oracle的SQL和SQLite的实现并不完全相同。 但核心语言是一样的。 这就是为什么你经常/有时为这两种产品编写相同的查询。 另一方面, PL / SQL是Oracle 专有的程序语言。 它由Oracle Corporati ...
-
oracle plsql动态循环(oracle plsql dynamic loop)[2022-04-02]
假设您只想让光标工作: DECLARE C INTEGER := 0; TYPE MyCurTyp IS REF CURSOR; v_my_cursor MyCurTyp; v_col1 varchar2(20); -- replace varchar2(20) with correct data type v_col2 varchar2(20); -- replace varchar2(20) with correct data type BEGIN SE ...