【问题标题】:Write SQL query to fetch data from below table [closed]编写 SQL 查询以从下表中获取数据 [关闭]
【发布时间】:2013-07-02 03:51:29
【问题描述】:
column1 column2 column3
A           B     50
B           A     50
C           D     50
D           C     10

从上表中,编写一个查询来获取数据

column1 column2 column3
A        B        100
C        D         60

column1 column2 column3
B        A        100
D        C         60

【问题讨论】:

  • 工资是多少?
  • 家庭作业?你有没有尝试过?

标签: mysql sql


【解决方案1】:

这不是完整的解决方案。只是提示你做功课。

select a.column3 + b.column3 from
mytable a, mytable b
where a.column1 = b.column2
and a.column2 = b.column1;

【讨论】:

    猜你喜欢
    • 2021-09-06
    • 1970-01-01
    • 1970-01-01
    • 2019-05-06
    • 2013-09-08
    • 1970-01-01
    • 2021-12-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多