我的方法是这样的
var
name,sex,age,email,homepage:string;
sql :string;
begin
if trim(edtname.text) = '' then name = '%' else name = edtname.text;
................
if trim(edthomepage.text) = '' then name = '%' else name = edthomepage.text;
sql := 'SELECT * FROM TABLE WHERE NAME LIKE :NAME,SEX LIKE :SEX,AGE LIKE :AGE.....';
//绝对没问题的
// 我在ORACLE上有20多个条件组合查询
end;