ITPub博客

首页 > 数据库 > 数据库开发技术 > 对于模糊查询的问题

对于模糊查询的问题

原创 数据库开发技术 作者:rickmistgun 时间:2007-05-23 16:06:04 0 删除 编辑

bookmgr.book_name = "%" + txtbook_name.Text + "%";
bookmgr.book_author = "%" + txtbook_author.Text + "%";

bookmgr.book_pub = "%" + txtbook_pub.Text + "%";

strSQL.Append("SELECT a.book_id , a.book_name , a.book_author , a.book_pub, ");
strSQL.Append("a.book_flg , a.book_pst , b.bor_date ,b.rtn_date ");
strSQL.Append(" FROM book_master a , book_manager b ");
strSQL.Append(" where a.book_name like ? ");
strSQL.Append(" and a.book_author like ? ");
strSQL.Append(" and a.book_pub like ? ");
strSQL.Append(" and a.book_type like ? ");
strSQL.Append(" and a.book_id = b.book_id(+) ");


db.DbParametersClear();
db.DbPsetString("book_name", _book_name);
db.DbPsetString("book_author", _book_author);
db.DbPsetString("book_pub", _book_pub);
db.DbPsetString("book_type", _book_type);

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9533622/viewspace-916007/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2011-02-21

  • 博文量
    5
  • 访问量
    3275