SQL avoid to duplicates sql join command - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

how to avoid to duplicates in sql join command ?


 73

SQL


0

// we want to get all records with SMILE happy and Field Node and Id 1003

//Table_1
//id SMILE
//1003 HAPPY
//1001 HAPPY
//1002 SAD
//1003 HAPPY
//1001 HAPPY
//1003 HAPPY

//Table_2
//id Field
//1003 Node
//1001 Java
//1002 PHP
//1006 Node
//1001 C
//1005 Node

select * from Table_1 T1 left join Table_2 T2 on T1.ID = T2.id and T2.Field = 'NODE' where T2.Field is not null and T1.SMILE = 'HAPPY' and T1.id = 1003

// this condition is very important "T2.Field is not null"


By        
The power of the user (%)
80%



The most helpful SQL solutions

how to execute select into using sql ?how to execute select into using sql ?SQL

Click to see more ...

  620     53

convert string to date sqlconvert string to date sqlSQL

Click to see more ...

  529     42

How to get the last record from table using sql ?How to get the last record from table using sql ?SQL

Click to see more ...

  454     33

create table sqlcreate table sqlSQL

Click to see more ...

  228     23

How use like using sql ?How use like using sql ?SQL

Click to see more ...

  305     22

How to get the last 10 records using mysql ?How to get the last 10 records using mysql ?SQL

Click to see more ...

  199     21

rows to columns sqlrows to columns sqlSQL

Click to see more ...

  154     17

insert new column into table sqlinsert new column into table sqlSQL

Click to see more ...

  153     16

How to convert the values to lowercase using sql ?How to convert the values to lowercase using sql ?SQL

Click to see more ...

  164     13

How to change a negative number to positive using sql ?How to change a negative number to positive using sql ?SQL

Click to see more ...

  117     11

Welcome aboard!
We are happy you are here and
wish you good net-raft!