开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜