我有以下查询,我试图在Django 1.6 ORM中设置它
SELECT * FROM pharol.product
where name like "%PARACETAMOL%" or principe_active like "%PARACETAMOL%"
order by case when name like 'PARACETAMOL%' then 0 else 1 end, name
从查询中我已经设置了查询,但它正在减去order by case when name like 'PARACETAMOL%' then 0 else 1 end, name
。
有什么想法吗?