postgresql Delete+ join

using tablename as alias

DELETE FROM tv_episodes
USING tv_episodes AS ed
LEFT OUTER JOIN data AS nd ON
   ed.file_name = nd.file_name AND
   ed.path = nd.path
WHERE
   tv_episodes.id = ed.id AND
   ed.cd_name = ‘MediaLibraryDrive‘ AND nd.cd_name IS NULL;

  

时间: 2024-08-07 04:31:56

postgresql Delete+ join的相关文章

How to resolve the truncate/drop/delete/join hang issue in ADW

In some case, we found that when we execute the sql commands like truncate table, drop table, delete all records in table, join 2 tables, it will take very very long time, and the execution is still in progress, no any result returned. Probably it is

postgresql inner join

test=> select * from favoriteguidance test-> ; userid | createtime | objectcreatetime | title | objectid -----------+-------------------------------+-------------------------------+-----------+----------- 100000004 | 2017-08-07 00:27:26.452547-04 |

postgresql server start and then immediately stop

I had the same issue installing 9.1.4 on Windows 7. I managed to find a solution online that worked. The steps I followed are: Uninstall PostgreSQL Delete the postgres user if it still exists. net user postgres /delete Create the postgres user with a

How Distributed Outer Joins on PostgreSQL with Citus Work

转自: https://docs.citusdata.com/en/v7.5/articles/outer_joins.html SQL is a very powerful language for analyzing and reporting against data. At the core of SQL is the idea of joins and how you combine various tables together. One such type of join: out

Postgres数据库基本介绍

最近一直在做一个和PostgreSQL数据库相关的项目,把自己在这个过程中学习的知识记录下来.关于PostgreSQL数据库网上已经有太多的相关介绍了,为了博文的系统性还是先看一下维基百科对PostgreSQL数据库的介绍吧. PostgreSQL是自由的对象-关系型数据库服务器(数据库管理系统),在灵活的BSD-风格许可证下发行.它在其他开放源代码数据库系统(比如MySQL和Firebird),和专有系统比如Oracle.Sybase.IBM的DB2和Microsoft SQL Server之

asp.net 网站开发常用方法

生成验证码: using System;  using System.Data;  using System.Configuration;  using System.Collections;  using System.Web;  using System.Web.Security;  using System.Web.UI;  using System.Web.UI.WebControls;  using System.Web.UI.WebControls.WebParts;  using

MySQL Foreign Key

ntroduction to MySQL foreign key A foreign key is a field in a table that matches another field of another table. A foreign key places constraints on data in the related tables, which enables MySQL to maintain referential integrity. Let’s take a look

Sales Portal遇到问题及解决

1, 拼接sql时, exec sp_executesql @sql报错“Procedure expects parameter '@statement' of type 'ntext/nchar/nvarchar'.” 这是因为@sql类型应该为nvarchar()========================================== 2, 存储过程中用到事务,return别忘了提交事务========================================= 3,EXE

DB2 错误代号 笔记

返得利购物   http://www.bbuy8.com 购物返利天经地义,返利不高,叫毛返利 (1) SQL State: 42831 [Error Code: -542, SQL State: 42831]  DB2 SQL Error: SQLCODE=-542, SQLSTATE=42831, SQLERRMC=BATCH_NO, DRIVER=3.57.82 列子: