开发者

Joining 2 tables where any of 3 columns in 1 table may match the join column in the second table

开发者 https://www.devze.com 2023-01-29 06:51 出处:网络
There are 2 tables tblCaller contains the phone numbers of calls receivedin a column cCaller. tblClient contains clients personal details including phone numbers in 3 columns cNumHome, cNumWork and

There are 2 tables

tblCaller contains the phone numbers of calls received in a column cCaller.

tblClient contains clients personal details including phone numbers in 3 columns cNumHome, cNumWork and cNumCell.

I need to join the tables to create a recordset so that the personal details of callers can be displayed.

Is a query containing 2 unions the only way to do this?

A redesi开发者_开发问答gn of the table is not an option at present


A join might also work:

select *
from tblCaller as cal
join tblClient as cli on cal.cCaller = cli.cNumHome or cal.cCaller = cli.cNumWork or cal.cCaller = cli.cNumCell
0

精彩评论

暂无评论...
验证码 换一张
取 消