Delphi如何多个条件调用

我在where后面调用一个条件时可以正常运行,但是如下面若调用2个条件

begin
Close;
SQL.Clear;
SQL.Add('select distinct code from alldata where type='''+ComboBox2.Text+''' and group='''+ComboBox3.Text+'''');
Open;
end;

会怎么样?
问问题得会问啊
谁知道你遇到了什么问题?

说明没有同时符合两个条件的数据呗。如果是两者之一,用or代替and

SQL.Add('select distinct code from alldata where type='''+ComboBox2.Text+''' and group='''+ComboBox3.Text+'''');提示说语法错误。但是若where后面只挂一个条件SQL.Add('select distinct code from alldata where type='''+ComboBox2.Text+''' ');就可以正常运行。不知哪里写错了