我有两个表Employee和Grade,想要输出像第三个表(即输出表)? 如果可能的话怎么样?
答案 0 :(得分:4)
你可以试试这个
select e.name , g.grade
from employeetable e, gradetable g
where e.salary >= g.min
and e.salary <= g.max
答案 1 :(得分:2)
试试这个
SELECT
E.Name
,(SELECT G.Grade FROM Grade G WHERE E.Salary BETWEEN G.Min AND G.Max)
FROM Employee E