sql - Need to fetch records from one table which is not present in another one table -


I have two tables, one table has three columns and the other is two columns. I need to get a record from Table 1, which is not present in Table 2. For example, enter Table 1 Table (C1Int, C2Int, C3Int) @ Table 1 values ​​(1,1,1) @ Table 1 Enter values ​​(1,2,2) INSERT INSERT @ Table 1 value in table 1 values ​​(1,3,3) (2,1,4) DECLARE @ Table 2 table (C1 INT, C2 INT) @ table 2 Enter values ​​(1,1) Table 2 values ​​include INSERT (1,2)

I need the result as shown below

  C1C2C3---- ---- 1 3 3 2 1 4    

This should work:

  Select Table 1 * 1 Table 1 from Left Otar to Table 1 on Table 2. C1 = Table 2 C1 and Table 1 C2 = Table 2. C2 Where Table 2 C1 is zero and table 2 C2 is null    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -