鉴于字符串:
'我认为 PostgreSQL 很漂亮'
我想对该字符串中找到的单个单词进行操作。本质上,我有一个单独的,我可以从中获取单词详细信息,并希望在此字典上加入该字符串的未嵌套数组。
到目前为止,我有:
select word, meaning, partofspeech
from unnest(string_to_array('I think that PostgreSQL is nifty',' ')) as word
from table t
join dictionary d
on t.word = d.wordname;
Run Code Online (Sandbox Code Playgroud)
这完成了我希望做的事情的基本原理,但它没有保留原始的词序。
在我看来,应该可以用包sys.diana和解析现有的 PL/SQL sys.pidl,但我在互联网上没有找到任何东西,除了一些似乎解开包装包的脚本(这对我的目的来说是无用的) )。
那么,有没有人知道指向正确方向的指针?
我希望确保 php web 应用程序中的所有查询都正确使用了绑定变量,以尽量减少对查询的解析。
我想知道 Oracle 如何解析将列与值列表进行比较的查询。Oracle 会认为这些语句是相同的,还是列表必须在绑定变量内?
select char from alphabet where char not in ('a', 'b');
select char from alphabet where char not in ('c', 'd');
Run Code Online (Sandbox Code Playgroud)
如果列表的内容必须在绑定变量中,是否可以使用单个变量来完成,或者必须将列表中的每个项目放在一个单独的变量中?
select char from alphabet where char not in (:list);
select char from alphabet where char not in (:c1, :c2);
Run Code Online (Sandbox Code Playgroud)
如果后者为真,列表中具有不同项数的查询是否仍被认为具有相同的结构?
select char from alphabet where char not in (:c1, :c2);
select char from alphabet where char not in (:c1, :c2, :c3);
Run Code Online (Sandbox Code Playgroud)