SQL query to return a data that both creteria exist in one table
Posted
by Ali
on Stack Overflow
See other posts from Stack Overflow
or by Ali
Published on 2010-04-24T14:19:26Z
Indexed on
2010/04/24
14:23 UTC
Read the original article
Hit count: 746
Dear all,
I have a TWO tables of data with following fields table1=(ITTAG,ITCODE,ITDESC,SUPcode) table2=(ACCODE,ACNAME,ROUTE,SALMAN)
this my customer master tables that contains my customer data such as customer code, customer name and so on...
Every Route has a supervisor(table1=supcode) and I need to know supervisor name in my table which both supervisor name and code exist in one table.
table1 has contain all names separated by ITTAG. for example, supervisor name's ITTAG='K' also salesamn name's ITTAG='S'.
ITTAG ITCODE ITDESC SUPCODE ------ ------ ------ ------- S JT JOHN TOMAS TF K WK VIKI KOO NULL
NOW THIS IS A RESULT WHICH I WANT
ACCODE ACNAME ROUTE SALEMANNAME SUPERVISORNAME ------- ------ ------ ------------ --------------- IMC1010 ABC HOTEL 01 JOHN TOMAS VIKI KOO
i hope this this information is sufficient to get the query..
Thanks Ali
© Stack Overflow or respective owner