


怎样实现外键关联的模糊查询
用这个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 编辑 ]