Question : If I have an expensive function call that takes a JSONB and returns an INT, e.g. CREATE FUNCTION […]
Tag: order-by
ORDER BY count and Bitmap Heap Scan
Question : I have a table with hits: Column | Type | Modifiers ————–+—————————–+————————————————— id | integer | not null […]
How does ORDER BY FIELD() in MySQL work internally
Question : I understand how ORDER BY clause works and how the FIELD() function works. What i want to understand […]
ORDER BY that doesn’t contain repeating values
Question : Relevant SQL Fiddle (postgres 9.2) How do I state a SELECT .. ORDER BY .. that avoids having […]
weird sql server behavior when inserting and selecting
Question : Today after one of the drives on our sql server ran out of space. The drive contained eventracker […]
Best index for case insensitive match on one field and ordering by another field
Question : I want to run a query like this: SELECT * FROM “core_user” WHERE UPPER(“core_user”.”email”::text) = UPPER(’emailsearch@example.com’) ORDER BY […]
Why does ORDER BY not belong in a View?
Question : I understand that you cannot have ORDER BY in a view. (At least in SQL Server 2012 I […]
Slow MySQL query with Order and Group by
Question : I have a query that is taking a long time to execute (1.13s). The two tables user_articles and […]
How can I join two tables while filtering the results with a” WHERE IN” clause? [closed]
Question : Closed. This question is off-topic. It is not currently accepting answers. Too localized – this could be because […]
sort results by highest performing country & region
Question : I want to check which country & regions are performing the best in sales. I have the following […]