我只想显示 PostgreSQL 中没有子分区表的顶级表的列表。(当前使用 PostgreSQL 12。)
\dt
在 psql 中给我所有表,包括表的分区。我看到这个:
postgres=# \dt
List of relations
Schema | Name | Type | Owner
--------+------------------------------+-------------------+--------
public | tablea | table | me
public | partitionedtable1 | partitioned table | me
public | partitionedtable1_part1 | table | me
public | partitionedtable1_part2 | table | me
public | partitionedtable1_part3 | table | me
public | tableb | table | me
Run Code Online (Sandbox Code Playgroud)
但我想要一个这样的列表,没有父分区表的子分区:
List of relations
Schema | Name | Type | Owner
--------+------------------------------+-------------------+--------
public | tablea …
Run Code Online (Sandbox Code Playgroud) 我有一个列表是一个键值配对列表.像下面这样的东西
key1 value1 key2 value2 key3 value3
Run Code Online (Sandbox Code Playgroud)
我想将其映射到数组或字典.
目前,我的代码看起来像这样
for {set i 0} {$i < [llength $list]} {incr i} {
if {[expr {fmod($i,2)}] == 0} {
set key [lindex $list $i]
} else {
set v_array(${key}) [lindex $list $i]
}
}
Run Code Online (Sandbox Code Playgroud)
在perl中,我知道这可以在一次传递中分配到键值字典中.在Tcl中有这么简单的方法吗?
我试图在Oracle SQL中编写一个查询,如果字段1中的值不等于字段2中的值(其中field2包含一些空值),则返回行
如果表格看起来像这样
Field1 Field2
1 1
2 3
4
Run Code Online (Sandbox Code Playgroud)
如果我使用此查询:
select * from table where field1 != field2
Run Code Online (Sandbox Code Playgroud)
我只返回第2行,但不是第3行.是否有一个查询我可以用来获取2,3行检索?