我知道Oracle支持多个字符集,但是如何确定我工作的当前11g系统是否启用了该功能?
我遇到过这样的代码,我需要使用ANSI标准重新编写,我想确保我保持连接正确.那么,这是什么惯例?
使用此约定的其他类型连接的语法是什么?
使用这个约定,(+) 总是在表达式的右边?
我在哪里可以了解更多相关信息?
我想计算每个 id 的负值和正值。
ID=1 has 2 positive and 0 negative transactions. etc.
with trans_detail as
(
select 1 as trans_id, 100 as trans_amount from dual union all
select 1 as trans_id, 200 as trans_amount from dual union all
select 2 as trans_id, -100 as trans_amount from dual union all
select 2 as trans_id, -300 as trans_amount from dual union all
select 3 as trans_id, 400 as trans_amount from dual union all
select 3 as trans_id, -500 as trans_amount from …Run Code Online (Sandbox Code Playgroud) 使用 PL/SQL,如何删除除第一次出现以单词 开头的句子之外的句子This product?假设每个句子都以句点 ( .) 结尾,并且每个句子都以大写字母开头;例如:
v_desc varchar2(500);
v_desc := 'This product is used. Product may make you wealthy. This product may appear red. This product is not new.';
Run Code Online (Sandbox Code Playgroud)
我的尝试:
v_desc := regexp_replace(v_desc,'This product*{2,}','') ;
v_desc := regexp_replace(v_desc,'This product*{2,}*','') ;
Run Code Online (Sandbox Code Playgroud)
期望的结果
v_desc := 'This product is used. Product may make you wealthy.';
Run Code Online (Sandbox Code Playgroud) 我想在我的CASE语句中使用REGEXP_LIKE
2个问题
如何让REGEXP_LIKE在此CASE语句中工作?我收到以下错误消息
ORA-00904: "TRUE": invalid identifier
重新正则表达式,为什么select '12345678' from dual查询返回1?
正则表达式规则
0到6位,后跟0或1个小数点,后跟0到6位数.
with expression_row as
(select 'zzzz' as expression from dual union all
select '12345678' as expression from dual union all
select '12.33333' as expression from dual union all
select '.222222' as expression from dual)
select
expression,
case regexp_like( expression, '^\d{0,6}(\.{0,1}\d{0,6})$')
-- [0-6 digits][0-1 decimal][0-6 digits]
when TRUE then 'Y'
else 'N'
end as valid_y_n
from expression_row;
Run Code Online (Sandbox Code Playgroud)
期望的输出
zzzz N
12345678 N
12.33333 Y
.222222 …Run Code Online (Sandbox Code Playgroud) 要在 AWK 中处理的记录具有以下可能的格式:
foobar是固定长度,serialno是可变长度,我想捕获的字段可能包含零个或多个下划线。
foobar_823932230_processname.txt
foobar_82393280_process_name.txt
foobar_8239330_foo_process_name.txt
Run Code Online (Sandbox Code Playgroud)
期望输出
processname
process_name
foo_process_name
Run Code Online (Sandbox Code Playgroud)
如果我使用,FS="[_.]"那么我可以print $3用于第一条记录,但不适用于第二条和第三条记录。
如何捕获序列号和 .txt 之间的所有内容?
我正在编辑需要更改的旧版 AWK 代码。一旦我正确捕获了这个字段,awk 进程就会继续生成额外的输出。
当我只有一个状态代码作为参数时,这可以工作.
当我在parm_list中有多个state_code时,如何让代码工作?
要求:
(1)我不想在光标定义中硬编码状态代码
(2)我确实想在where子句中允许多个州代码
例如:我想为parm_list =('NY','NJ','NC')运行此代码.我在将parm_list中的单引号与'where state_code in'查询中的单引号进行协调时遇到了困难.
set serveroutput on;
DECLARE
parm_list varchar2(40);
cursor get_state_codes(in_state_codes varchar2)
is
select state_name, state_code from states
where state_code in (in_state_codes);
BEGIN
parm_list := 'NY';
for get_record in get_state_codes(parm_list) loop
dbms_output.put_line(get_record.state_name || get_record.state_code);
end loop;
END;
Run Code Online (Sandbox Code Playgroud) 使用Oracle 11g表格11.1.2
编译错误为:
Column Mapping: FUBAR_ID
FRM-30049: Unable to build column mapping.
LOV WEB_PAGE_LOV Form: FORM_FUBAR
FRM-30085: Unable to adjust form for output.
Run Code Online (Sandbox Code Playgroud)
列确实不正确,因为它应该是另一个列名(BIZZ_ID)
我看到了LOV树分支,也看到了LOV对象,但是我的检查并未导致我找到任何列名。
问题:如何更改LOV对象中的列名?
即使在fruit_batch_info中没有记录,我也希望在我的结果中使用AP01,所以我正在使用左连接.
但是,只要我添加'where fruit_batch_info = 11',我的AP01就不再出现在我的结果中.
如何将AP01保留在我的结果中?
要求: 报告'all_fruits'中的所有记录以及有关'fruit_batch = 11'的任何信息
期望的结果
ID , DESC , BATCH, STORAGE
----- -------- ------ ------------
APO1, Apple , null , null
PE01, Pear , 11 , Warehouse-11
KU01, Kumquat, 11 , Warehouse-11
Run Code Online (Sandbox Code Playgroud)
这是我的查询:
with all_fruits as
(select 'AP01' as fruit_id, 'Apple' as fruit_desc from dual union all
select 'PE01' as fruit_id, 'Pear' as fruit_desc from dual union all
select 'KU01' as fruit_id, 'Kumquat' as fruit_desc from dual),
fruit_batch_info as
(select 'PE01' as fruit_id, '10' …Run Code Online (Sandbox Code Playgroud) 使用Oracle 11g
我想要一个以其他方式排序的表的单个异常
select fruit as popluar_choices
from menu
order by fruit /* Exception put 'grapefruit' at top of list */
Run Code Online (Sandbox Code Playgroud)
期望的结果
popular_choices
-----------
grapefruit
apple
fig
kiwi
lemon
pear
Run Code Online (Sandbox Code Playgroud)
它类似于这篇文章: 如何应用非标准SQL列排序顺序?
使用OracleForms Builder 32bit v 11.2.如何更改此图片中突出显示的表单名称?