从列中检索条目并与同一列中的其他条目进行比较

时间:2017-07-09 06:44:02

标签: mysql

我有一个员工数据库,其中包含薪水和姓名作为列。我想列出所有员工的薪水超过一个名为' x'来自数据库本身。

如何解决此查询?

2 个答案:

答案 0 :(得分:0)

你可以试试这个:

Select * from Employees where salary > (select salary from Employees where name = 'Katz' );

小例子

enter image description here

答案 1 :(得分:0)

获得员工的工资' x'作为内部查询并通过比较他们的工资与x的工资来检查所有记录并显示它们。

Dim StartPoint As Variant
Dim LeaderPt(8) As Double    'a separate array for leader points

'Specify insertion point
StartPoint = ACAD.ActiveDocument.Utility.GetPoint(, "Specify insertion point")

'-----Set points for the leader-----
LeaderPt(0) = StartPoint(0)
LeaderPt(1) = StartPoint(1)
LeaderPt(2) = StartPoint(2)

LeaderPt(3) = StartPoint(0) + 50   '2nd point x coordinate.
LeaderPt(4) = StartPoint(1) + 50   '2nd point y coordinate.
LeaderPt(5) = StartPoint(2)

'add a third point so the last point of the leader won't be set to (0,0,0)
LeaderPt(6) = LeaderPt(3) + 25     '3rd point x coordinate. Offset from second point
LeaderPt(7) = LeaderPt(4)          '3rd point y coordinate. Same as the second point
LeaderPt(8) = LeaderPt(5)
'---


Set leader1 = ACAD.ActiveDocument.ModelSpace.AddLeader(LeaderPt, annotationObject, leaderType)