SQL count(*)和*

    preparedStatement = connection.prepareStatement(sql);
            preparedStatement.setString(1,logname);
            resultSet = preparedStatement.executeQuery();
            if(resultSet.next()){
                flag = true;
            }else{
                flag = false;
            }

这边用count(*),无论是否查询到,都会使result=true,所以查询语句以后用

select * from 

你可能感兴趣的:(SQL count(*)和*)