开发者

Find a value in a field based on matching a different field in the table with that in another table

开发者 https://www.devze.com 2023-02-12 17:27 出处:网络
I am trying to do something really simple but am having a lot of trouble. I have two tables one structured with the following fields

I am trying to do something really simple but am having a lot of trouble. I have two tables one structured with the following fields

member开发者_JS百科.tx_nickname var(100)
member.accountnumber int

memtransactions.accountnumber (FK uniqueidentifier)

what I want to do is lookup member table and find the nickname in the member table for the record where member.accountnumber = memtransactions.accountnumber

I have tried a few but i keep getting errors with field type conflicts

Thank you


Try this:

SELECT member.tx_nickname
FROM member m
JOIN memtransactions mt ON m.accountnumber = mt.accountnumber
0

精彩评论

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