我有两张桌子,"用户"和"乔布斯"。
用户表:
UserID
Username
Password
AccountType
Forename
Surname
ContactNumber
EmailAddress
工作表:
JobID
JobTitle
JobDescription
JobLocation
JobDate
JobStartTime
JobPay
PostedDate
PostedBy
AcceptedBy
JobStatus
我想显示所有作业行,以及来自users表的Username,ContactNumber和EmailAddress,其中" AcceptedBy"在jobs表中与" UserID"相同来自用户表。
答案 0 :(得分:1)
尝试此查询
SELECT * FROM Jobs INNER JOIN Users ON Jobs.AcceptedBy = Users.UserID
答案 1 :(得分:0)
我将向您展示其他示例并尝试使用您的示例
SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDate
FROM Orders
INNER JOIN Customers
ON Orders.CustomerID=Customers.CustomerID;
享受:)