打印

[问题求助] 怎样实现外键关联的模糊查询

怎样实现外键关联的模糊查询

用这个sql时候select * from wj_bulletin_boards where id in (select bulletin_board_id from wj_bulletin_board_attachments where file_name like '%#{@strKeyword}%')
报‘%‘的错!
但是用@wj_bulletin_boards = WjBulletinBoardAttachment.find :all,:conditions=>['file_name like ?',"%#{@strKeyword}%"]的时候不知道怎么做外键关联的查询。
哪位强人,高手!帮我解决一下咯! 谢了!

[ 本帖最后由 liupei520520 于 2008-3-18 13:03 编辑 ]
本帖最近评分记录
  • manti R币 +3 鼓励提问 2008-3-24 13:08
  • wscc111 R币 +5 鼓励提问! 2008-3-18 09:11

TOP

2008-11-24 00:30 Crawled by CCBot/1.0 (+http://www.commoncrawl.org/bot.html) @38.103.63.61