100分在线等一个SQL语句!

zhz586 2004-07-20 11:09:24
数据库中:company_id,pass,end_date,company_name!
我要在该表中通过公司company_id或者公司名称company_name找到pass=1和end_date>now()的记录。
下面的语句肯定不对,高手们帮我下吧~~~
strSQL = "select * from buy_and_sell_info where company_id = "+ member_id + " or company_name = '%"+ name +"%' and end_date >=now() and pass = 1 order by ID DESC";
...全文
66 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
trampwind 2004-07-20
  • 打赏
  • 举报
回复
strSQL = "select * from buy_and_sell_info where (company_id = "+ member_id + " or company_name = '%"+ name +"%') and end_date >=now() and pass = 1 order by ID DESC";
嬉皮 2004-07-20
  • 打赏
  • 举报
回复
strSQL = "select * from buy_and_sell_info where (company_id = "+ member_id + " or company_name = '%"+ name +"%') and end_date >=now() and pass = 1 order by ID DESC";

56,678

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧