Tuesday, July 30, 2019

Re: Recreating SQL query in ORM

yes

On Tuesday, July 30, 2019 at 10:26:56 PM UTC+5:30, Jonathan Spicer wrote:
Hello,

I have an sql query that I would like to recreate using the ORM. Would it be possible for someone to give me some pointers.

select count(*) as total,
                concat(loading_code,code1_code,code2_code,code3_code,code4_code) as seq,
                concat(loading_id,',',code1_id,',',code2_id,',',code3_id,',',code4_id) as ids
                from FullMatches where job_id = %s group by seq, ids order by total desc

Thanks in advance.

Johnny

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a24d2cbe-1230-4ef5-813f-6cc6739ccd0f%40googlegroups.com.

No comments:

Post a Comment