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.
嗨,我想选择一个具有最大 ID(主键)值的行,其中有 patient_id=xyz
以下是我的 sql 脚本
check="Select * from notes where id=max(ID) in (SELECT * FROM notes WHERE patient_id="+patientSoapBean.getPatientID()+")";
我收到无效使用组功能错误。你能指出其中的错误吗?
您可能正在尝试这样做:
SELECT * FROM notes WHERE patient_id = ? ORDER BY id DESC LIMIT 1