Co to jest operator konkatenacji łańcuchów w Oracle?
Jaki jest operator konkatenacji łańcuchów w Oracle SQL?
Czy są jakieś "ciekawe" funkcje, na które powinienem uważać?
(wydaje się to oczywiste, ale nie mogłem znaleźć poprzedniego pytania zadającego to).
140
4 answers
Jest ||
, na przykład:
select 'Mr ' || ename from emp;
Jedyną "interesującą" funkcją, o której myślę, jest to, że 'x' || null
zwraca 'x'
, a nie null
, Jak można się spodziewać.
197
Author: Tony Andrews,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-03-03 10:07:33
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-03-03 10:07:33
Jest też concat, ale nie używa się go zbyt często
select concat('a','b') from dual;
56
Author: Gary Myers,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2008-11-10 22:09:11
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2008-11-10 22:09:11
Sugerowałbym concat, gdy mamy do czynienia z 2 strunami, i / / gdy te struny są większe niż 2:
select concat(a,b)
from dual
Lub
select 'a'||'b'||'c'||'d'
from dual
7
Author: Fabio Fantoni,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-04-22 13:39:01
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2016-04-22 13:39:01
DECLARE
a VARCHAR2(30);
b VARCHAR2(30);
c VARCHAR2(30);
BEGIN
a := ' Abc ';
b := ' def ';
c := a || b;
DBMS_OUTPUT.PUT_LINE(c);
END;
Wyjście:: Abc def
5
Author: Ankur,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-05-14 13:22:33
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2018-05-14 13:22:33