-4

There are two tables

Table acctsmem:

E_CODE     E_NAME    E_DEPT
123456     chandu     it

Table acctsdata:

E_CODE     OBJ         SCORE   STATUS
123456     get data      1     FILLED

I want data as:

E_CODE   E_NAME    E_DEPT    STATUS
123456   chandu    it        FILLED
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129

2 Answers2

2

Use join to join the tables:

select t1.E_CODE,E_NAME,E_DEPT,STATUS from acctsmem t1 join acctsdata t2 on t1.E_CODE = t2.ECODE
Jens
  • 67,715
  • 15
  • 98
  • 113
1

you can use join, but try the query below. It can work as well..

select a.e_code, a.e_name, a.e_dept, b.status
from acctsmem a, acctsdata b where a.e_code = b.e_code;
  • 3
    I wouldn't recommend this syntax: http://stackoverflow.com/questions/1599050/ansi-vs-non-ansi-sql-join-syntax – sgeddes Oct 06 '14 at 05:24