On Feb 17, 6:26 am, Pab
<prabu.ne...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi,
>
> I am using sunspot solr for search i which i need to write query
> for following mysql query
>
> select sp.id as id,sp.upc, IF(spu.id IS NULL, p.name, spu.name) as
> name, IF(spu.id IS NULL, m2.name, m1.name) manufacturer_name,
> IF(spu.id IS NULL, b2.name, b1.name) brand_name,sp.store_id,IF(spu.id
> IS NULL, spu.manufacturer_id, p.manufacturer_id) as
> manufacturer_id,IF(spu.id IS NULL, spu.brand_id, p.brand_id) as
> brand_id,sp.aisle_no,sp.aisle_side_id,sp.section_aisle,sp.shelf_number
> from sal_products sp
> LEFT JOIN store_product_upcs spu on (spu.upc = sp.upc and
> spu.store_id = sp.store_id)
> LEFT JOIN manufacturer m1 on (spu.manufacturer_id >
m1.manufacturer_id)
> LEFT JOIN product p on (p.upc = sp.upc)
> LEFT JOIN manufacturer m2 on (p.manufacturer_id >
m2.manufacturer_id)
> LEFT JOIN brand b1 on (spu.brand_id = b1.brand_id)
> LEFT JOIN brand b2 on (p.brand_id = b2.brand_id) group by
> sp.upc
>
> could any one provide me solution?
No, nobody is going to be able to provide you a solution when you''ve
provided *no* information about how the data is stored in Solr...
--Matt Jones
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.