SQL -Joining table
I have 3 tables here with the columns as below:
ADDR - cifkey(PK), addr1,addr2,addr3,addr4,addr5,postcd
CIF- cifkey(PK), cust_id(PK)
TEMP - cust_id(PK)
I have a program to insert record at TEMP table which having cust_id as primary key. With the cust_id, I would like to retrieve address and postcode from table ADDR and return back to the program. The selection should based on the cifkey and cust_id among these 3 tables.
I have come out a basic SQL as below and would like to seek for advice..
select a.addr1,a.addr2,a.addr3,a.addr4,a.addr5,a.postcd from ADDR a, CIF b, TEMP c where a.cifkey=b.cifkey and b.cust_id= c.cust_id
what advice would you like to have?
Originally Posted by devil_vin
Originally Posted by r937
i would like know whether the SQL is feasible enough to retrieve what I wanted to achieve.
okay, that's fair
what happened when you tested it?