在我的 PostgreSQL 数据库(version: 11.4
中,有一个名为table_1
的表,该表只有一列。此列的数据类型是字符串数组(_varchar
)。
| dependencies |
|----------------|
|{\1} |
|{\1,\1\2} |
|{\1,\1\2,\1\2\3}|
此外,我有一个名为table_2
的表,其结构如下:
| employee | dependence |
|----------------|------------|
| Alex | \1 |
| Mark | \1 |
| Lily | \1\2 |
| Grace | \1\2 |
| Evie | \1\2 |
| Bob | \1\2\3 |
| Mark | \1\2 |
如何检查数组中是否包含字符串?就我而言,我试图检查dependence
的{{1}}列值是否存在于table_2
的{{1}}列的数组中。
换句话说,我正在尝试获得这样的结果:
dependencies
我尝试的SQL请求:
table_1
答案 0 :(得分:1)
尝试使用字段Sub ChangeFont()
Dim bpFontName As String
bpFontName = InputBox("What font would you like to change EVERYTHING to?")
With ActivePresentation
For Each Slide In .Slides
For Each Shape In Slide.Shapes
With Shape
If .HasTextFrame Then
If .TextFrame.HasText Then
.TextFrame.TextRange.Font.Name = bpFontName
'Set font size below
.TextFrame.TextRange.Font.Size = 30
'Set if you want the font bold below - msoFalse = no
.TextFrame.TextRange.Font.Bold = msoTrue
'Set if you want the font bold below - msoFalse = no
.TextFrame.TextRange.Font.Italic = msoTrue
End If
End If
End With
Next
Next
End With
End Sub
TEXT[]
表_1
select dependencies ,count(*) from table_1 join table_2
on dependence = ANY( dependencies)
group by 1
表_2
create table table_1
(
dependencies text[]
);
insert into public.table_1 (dependencies) values ('{1}');
insert into public.table_1 (dependencies) values ('{1,12}');
insert into public.table_1 (dependencies) values ('{1,12,123}');