Django 1.6查询集

时间:2017-11-18 05:10:48

标签: python mysql django orm django-queryset

我有以下查询,我试图在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

有什么想法吗?

0 个答案:

没有答案