Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要一些帮助来选择两个表的列的最大值。当我运行下面的 sql 语句时,我从两个表中得到最大值,即 2 行。如何获得两者的最大值(SQLITE 3)?
从 tbltrans union 中选择 max(transid) 从 tbltrans2 中选择 max(transid)
不管怎么说,还是要谢谢你。
做第union一个是一种方式:
union
select max(transid) from (select transid from tbltrans union all select transid from tbltrans2 ) t