就是通过两个字段,来确定一整行的数据,SQL语句要怎么写。。。
select * from table where columnA = ‘xx’ and columnB =‘xx’
表达不明确哦
如果你需要2个字段同时满足特定条件
select * from table where columnA = ‘xx’ and columnB =‘xx’
如果需要任何一个满足条件
select * from table where columnA = ‘xx’ or columnB =‘xx’
如果是mybatis使用
SELECT * FROM table_name WHERE column1 = #{column1} and column2 = #{column2}
如果是java代码中
String sql = "select * from table_name where column1='"+column1+"' and column2 = '" + column2"'";
stat.executeQuery(sql);