新手问题 rails 数据库查询问题

76521 · June 14, 2013 · Last by 76521 replied at June 24, 2013 · 2608 hits

ef self.find_all_by_tag_type(tag_type) find(:all,:conditions=>['tag_type =?',tag_type ] , :distinct=>tag_type) end 比如这个方法我要查询除去重复的 tag_type 这个字段的 所有数据 那地方那个条件该怎么写啊?

self.group(:tage_type)

find(:all, :select => "DISTINCT tag_type")
You need to Sign in before reply, if you don't have an account, please Sign up first.