且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

选择最大值行

更新时间:2022-06-18 22:23:05

您的查询看起来还可以,但不会导致最大appid的记录集.

试试

your query looks okay but it will not result the record set of the maximum appid.

try

select *
from Appointment
where appID = (
select max(appID)
from Appointment
where patID='p00000001')




另外,希望patID列是varchar吗?




Also, hope the patID column is varchar ?