通过以下查询,我们可以获得PostgreSQL中表的列名和数据类型列表.
foo我在当前目录中有一个文件。然后我运行以下命令:
find . -regex 'foo'什么也没找到find . -regex 'foo.*'什么也没找到find . -regex '.*foo'找到文件我希望这些命令中的任何一个都会产生积极的结果。
find命令版本是4.4.2
我正在尝试根据某些文件删除重复的行.当我运行以下查询时:
delete
from slowmo_vid as sv1, slowmo_vid as sv2
where sv1.video_id = '2luh6g3ni5ex'
and sv1.slowmo_end_t<=sv2.slowmo_end_t;
Run Code Online (Sandbox Code Playgroud)
我收到错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'as sv1, slowmo_vid as sv2
where sv1.video_id = '2luh6g3ni5ex'
and sv1.slowmo_end' at line 2
Run Code Online (Sandbox Code Playgroud)
表的字段是:id,video_id internal_uri,slowmo_end_t
我正在将数据库从 SQL Server 移植到 PostgreSQL。有没有sysobjectsPostgreSQL 的替代方案?如果是的话,那么它是什么以及如何使用它?
我的看法:
create view int_objects_v as
select
io.*, soae."REQ_TYPE_NAME", soae."REQ_TABLE_NAME",
stc1."CODE_DESC" int_type_name, stc2."CODE_DESC" operation_type_name,
s."NAME" target_obj_name
from
int_objects io
left join
req_request_types_v soae on soae."ID" = io."SOURCE_OBJ_ID"
left join
std_type_codes_v stc1 on (stc1."CODE" = io."INT_TYPE"
and stc1."TYPE" = 'intr_type')
left join
std_type_codes_v stc2 on (stc2."CODE" = io."OPERATION_TYPE"
and stc2."TYPE" = 'opr_type')
left join
sysobjects s on (s."ID" = io."TARGET_OBJ_ID")
where
io."ACTIVE_FLAG" = '1';
Run Code Online (Sandbox Code Playgroud)