1
我在查詢一列表,查詢的輸出是文本類型。我想檢查結果的基數。我正在使用string_to_array
命令,但我不知道應該爲分隔符指定什麼。下面的兩個命令不起作用:什麼分隔符應該用於PostgreSQL中的字符串分隔文本的string_to_array命令?
select rec from papers_stg where cardinality(string_to_array(rec,' ')) <> 11
select rec from papers_stg where cardinality(string_to_array(rec,'\t')) <> 11
下面是表papers_stg的前兩行:
7B5EDC52 Antibacterial Activity and Post-Antibiotic Effect of Flurithromycin Compared with Other Macrolides and Penicillins Against Periodontal Pathogens antibacterial activity and post antibiotic effect of flurithromycin compared with other macrolides and penicillins against periodontal pathogens 2013 2013/07/18 10.1179/joc.2001.13.3.255 Journal of Chemotherapy journal of chemotherapy 0794F580 19555
7932AE5F In Vitro Activity of Cefdinir against Respiratory Pathogens Isolated in Sicily with Reference to Beta-Lactamase Production in vitro activity of cefdinir against respiratory pathogens isolated in sicily with reference to beta lactamase production 2013 2013/07/18 Journal of Chemotherapy journal of chemotherapy 0794F580 19555
這裏是表說明:
Table "public.papers_stg"
Column | Type | Modifiers
--------+------+-----------
rec | text |