Search
 
SCRIPT & CODE EXAMPLE
 

SQL

compare subqueries oracle

// use NOT EXISTD (A MINUS B) instead of =

SELECT DISTINCT H1.HE_ID, H2.HE_ID
  FROM INV_HEAD H1, INV_HEAD H2
  WHERE H1.ID <> H2.ID
  AND NOT EXISTS(
    ((SELECT ART_ID, QUANTITY, PRICE FROM INV_POS WHERE HE_ID = H1.ID) 
      MINUS 
     (SELECT ART_ID, QUANTITY, PRICE FROM INV_POS WHERE HE_ID = H2.ID)) 
      UNION 
    ((SELECT ART_ID, QUANTITY, PRICE FROM INV_POS WHERE HE_ID = H2.ID) 
     MINUS 
     (SELECT ART_ID, QUANTITY, PRICE FROM INV_POS WHERE HE_ID = H1.ID)));
Comment

PREVIOUS NEXT
Code Example
Sql :: sql create text column limited values 
Sql :: insert statement with $1 
Sql :: sql server udf performance 
Sql :: sql server search all databases for objects 
Sql :: basic structure of sql expression having clause 
Sql :: trigger value from maltiple table to single table mysql 
Sql :: cassandra query example 
Sql :: sql server bool select 
Sql :: What are the advantages of MySQL when compared with Oracle? 
Sql :: how to create a new shema using query languaage 
Sql :: horizontal join sqlite 
Sql :: Search In the Data using ObjectName 
Sql :: if new such record in where condition in sql so what is return 
Sql :: query for backup a database at another location in file system 
Sql :: sql transact create cursor with dynamic tables 
Sql :: postgres create table like another table 
Sql :: get who is hired in month in sql 
Sql :: data table footer customize 
Sql :: Fatal error: Uncaught mysqli_sql_exception: Unknown or incorrect time zone 
Sql :: how to add postgres table in netbeans 
Sql :: alter server set options dbserver oracle fdw 
Sql :: sqlite3 not commit 
Sql :: druid sql list all tables 
Sql :: how much space does sql server take per row 
Sql :: how to change oracle sid name in 19c database 
Sql :: sql workbench 
Sql :: Sql testing queries 
Sql :: sqlite mode default 
Sql :: mysql service not starting 
Sql :: cross apply top for each row t1 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =