我很难理解这个问题。我想转换以下sql语句(从oracle转换为sql)以返回所有记录,而不是单个记录。
select *
from table_1
where ID = @myid and MyMonth = (select max (MyMonth) from table2 where ID = @myid)
Run Code Online (Sandbox Code Playgroud)
正如我所说,我想返回所有不针对 @myid 给定值的内容的摘要。
删除其中的 ID 部分不会返回任何内容。
谢谢,
尝试这个:
select *
from table_1 t1
where t1.MyMonth = (select max (t2.MyMonth) from table2 t2 where t1.ID = t2.ID)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
9762 次 |
| 最近记录: |