03-mORMot框架样例学习-03 Like模糊查询
https://synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_26
搜索RetrieveList
uses System.Generics.Collections; procedure TForm1.FindButtonClick(Sender: TObject); var aList: TObjectList<TSQLSampleRecord>; aRecord: TSQLSampleRecord; begin
//两个LIKE写法 aList := aSQLRest.RetrieveList<TSQLSampleRecord> ('Name LIKE ? or Info Like ? '
,['%'+StringToUTF8(NameEdit.Text)+'%', '%'+StringToUTF8(NameEdit.text)+'%']);// 一个LIKE 问号,后面一个逗号分开 for aRecord in aList do begin showmessage( aRecord.Name); end; aList.Free; end;