Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
72 views

I’m using Manticore Search 14.1.0 (Docker image manticoresearch/manticore:latest) on Ubuntu 20.04.6 LTS. I rely on cursor-style pagination with OPTION scroll, but when the sort clause includes a ...
Meet Vadodariya's user avatar
5 votes
4 answers
247 views

I need to sort a query's results by two methods at the same time. I want the first 3 records (returned) to be based on their prevalence in another table And then I want the rest of the results sorted ...
Gavin Baumanis's user avatar
-2 votes
1 answer
74 views

Mainly, I want to order the ids in descending direction but also, how can I sort parent product/items (the ones with empty ean) first and their child rows below them? Here's an example data from the ...
Jeremy's user avatar
  • 1
4 votes
2 answers
159 views

I have a table in Postgres (14) that is used like a queue with FOR UPDATE SKIP LOCKED queries. It was missing an index, but since any rows are usually processed quickly that never became a problem. ...
Tamas Kozma's user avatar
4 votes
1 answer
171 views

I need to implement keyset pagination (sometimes referenced as cursor-based or seek method) in Postgres with the following ordering rules: Rows where group_name = :priorityGroup come first (:...
Geba's user avatar
  • 3,398
0 votes
2 answers
113 views

In my application I want to find the latest duty of each user from 'StaffDuty' table using hibernate query (i.e. HQL). Below is my query. query = session.createQuery("FROM StaffDuty where deptId....
KJEjava48's user avatar
  • 2,073
1 vote
2 answers
65 views

I'm exploring the use of ArrayAgg and I don't understand why 'histidine-[13C6,15N3]' doesn't occur before 'isoleucine-[13C6,15N1]' in this example: In [25]: for i in Infusate.objects.annotate(tns=...
hepcat72's user avatar
  • 1,225
1 vote
2 answers
92 views

I have 3 tables in SQL: Agency, booking and checkin (and rooms) I need to compute a % of checkin / booking, by week number (of begin), by agency Here somes tables for example Agency : id name 1 first ...
Emmanuel's user avatar
0 votes
2 answers
126 views

I have the following stored procedure: CREATE PROCEDURE [dbo].[SearchPaymentsByComp] @CompId INT, @OrderByCol NVARCHAR(255), @OrderByDir NVARCHAR(255), @SearchDate DATE = NULL, @...
TheIronCheek's user avatar
  • 1,241
0 votes
2 answers
125 views

I have the below dataset which includes 3 columns: Inspection Id Inspection Date Fault Number Note: I have added in the 2 additional columns 'Comment' and 'Required Sort Order' to help explain what ...
BuckBuchanan's user avatar
0 votes
0 answers
51 views

Been trying to order the custom post type listing page based on a custom meta field. the meta field value would be in the form of string and number (pattern: '[string][unsigned]')(examples: 'A1','A2',....
Crystal Paladin's user avatar
2 votes
2 answers
124 views

Having this situation: SELECT DISTINCT "FieldName" FROM "TableName" ORDER BY "FieldName" ASC; I'd like to have the lines containing '%|%' first followed by the ones ...
StOMicha's user avatar
  • 481
1 vote
2 answers
123 views

Is there a way to efficiently order by a text field in a join query (i.e., fast on large datasets)? I understand that I probably need to filter the dataset somehow, to reduce the size of the dataset ...
Oskan's user avatar
  • 21
1 vote
2 answers
91 views

I have the following folders table: +----+--------+------+ | id | folder | user | +----+--------+------+ | 1 | Inbox | 0 | +----+--------+------+ | 2 | Drafts | 0 | +----+--------+------+ | 3 ...
John's user avatar
  • 1
0 votes
1 answer
89 views

I’m optimizing a query for better performance, and I use the following SQL statement: SELECT * FROM my_table WHERE status_flag = 0 AND event_date = '2025-03-25 23:59:59.999' AND id > 42006893 ...
Ruibin Zhang's user avatar
0 votes
1 answer
57 views

I have a query in Oracle where I need to: Order the entire table by a specific column. Select and lock a certain number of rows using SELECT FOR UPDATE. However, the issue is that Oracle first selects ...
Sa_am's user avatar
  • 29
1 vote
0 answers
67 views

I defined a redshift table (some fields omitted from this sample) with this DDL: CREATE TABLE public.my_sorting_test ( timestamp_utc timestamp without time zone ENCODE raw, filtered boolean ...
PunDefeated's user avatar
1 vote
1 answer
130 views

I have a base razor component, that loads data from a SQL database. To pass a sort order to this component, there are two "sort" Func<T,object> parameters and two bool to set asc/desc. ...
Helmut's user avatar
  • 502
0 votes
2 answers
121 views

I have a model Release. Each release has a type, and depending on that type different types of Credit are considered primary credits. I want to be able to order releases by the Entity names of their ...
bur's user avatar
  • 899
2 votes
6 answers
118 views

I want to arrange pending orders by eta in asc order and completed orders in desc order, with all completed orders appearing at the bottom of the list. Not sure if this is possible in a single query. ...
nj167252's user avatar
  • 173
-2 votes
1 answer
101 views

Any known explanation of this? Why Order By ASC doesn't return any item but order by DESC doesn't? I am using postgres with pg_vector extension SELECT langchain_pg_embedding.document, ...
Sudip Mondal's user avatar
-2 votes
3 answers
83 views

I would like to get my entries ordered by a specific pattern. For example I have an array like this arr = [2,5,3,9,4] Now I want to get the entries from my db by ID in the order of the array. I would ...
Ilan Sagital's user avatar
0 votes
0 answers
62 views

I use spring boot, and I want to add specific days to date column in mysql database on hql query order by clause. But which results error when I tried. I need to get results in the order of adding ...
KJEjava48's user avatar
  • 2,073
-2 votes
1 answer
54 views

I have a pretty basic Yii2 ActiveRecord query. $paperList = Paper::find()->orderBy(['id' => SORT_DESC])->all(); id is my primary key column which is of type int and AUTO_INCREMENT. When ...
Quentinb's user avatar
  • 510
-1 votes
2 answers
54 views

Using : sum(Age) over(partition by Country) as Total Id FirstName LastName Age Country Total ----------- --------------- ---------- ----------- --------------- -...
jessejbweld's user avatar
0 votes
1 answer
118 views

I have this query: --10/24/24 - UNIT PRICE AND QTY SHIPPED SELECT DBO.SHIPPER.PACKLIST_ID, dbo.shipper.SHIPPED_DATE, DBO.SHIPPER.CUST_ORDER_ID, dbo.SHIPPER_LINE.SHIPPED_QTY, dbo....
Eric's user avatar
  • 941
1 vote
0 answers
55 views

I've got a custom post type for staff. The fields are first_name, last_name, job_title, telephone, email, and notes. All staff are categorized by location using WP core Category. I need to output the ...
banacan's user avatar
  • 115
0 votes
2 answers
68 views

I have a table Users with id, this table has a million records or more. So when fetching data from the table I am using batching with offset & limit to reduce load on my server. My question is if ...
Manu S Rao's user avatar
0 votes
1 answer
210 views

I have a query in Snowflake where I am returning both numeric and varchar values and am struggling with getting the sort to work correctly. For context, this column is calculated by dividing two ...
BenTen's user avatar
  • 503
1 vote
3 answers
136 views

I'm trying to execute a SQL query with a left join with sum, group by and order by clauses in MS Access. But the result is not correct - perhaps the SQL code I am using is wrong. Table Expense ID ...
dlaksmi's user avatar
  • 213
0 votes
3 answers
144 views

In an Oracle SQL query which uses binary sorting rules, numbers are sorted before letters. But if the query uses a language specific collation to enable linguistic sorting, then numbers are sorted ...
cremor's user avatar
  • 6,935
1 vote
3 answers
119 views

In an Oracle SQL query which uses binary sorting rules, numbers are sorted before letters. But if the query uses a language specific collation to enable linguistic sorting, then numbers are sorted ...
cremor's user avatar
  • 6,935
0 votes
1 answer
55 views

Example Fiddle CREATE TABLE Demo (JobID INT(11), Status VARCHAR(250), InvoiceStatus VARCHAR(250)); INSERT INTO Demo (JobID, Status, InvoiceStatus) VALUES (1, "Active", NULL), (2,...
Ben Holness's user avatar
  • 2,745
0 votes
1 answer
80 views

I'm trying to select query from record count more than 1 (ID&DATE&INOUT) and count more than 2 (ID&DATE) with custom column (Option) in MS Access so with "NO" in the option ...
dlaksmi's user avatar
  • 213
1 vote
1 answer
99 views

I've got a table with a column of BANK_ID alphanumeric (VARCHAR2 in Oracle, VARCHAR in SQL Server) length 12. There are three records with BANK_ID of BARCLAYS, BARCLAYS_LDN and BARC_FRA_EUR. In Oracle,...
AddicksAddict's user avatar
1 vote
2 answers
171 views

I'm trying to select query from row count more than 2 based on ID and DATE and OPTION in MS Access. so with "NO" in the option column then the record more than 2 is not included in my sql ...
dlaksmi's user avatar
  • 213
1 vote
1 answer
83 views

I'm trying to select query from row count more than 2 based on ID and DATE in MS Access. Please Guide me I want to keep it as a single query. Thanks Table Absen ID DATE TIME INOUT 5008 28-Apr-24 08:00 ...
dlaksmi's user avatar
  • 213
0 votes
2 answers
68 views

Suppose there is a list of clients and each client has different contracts that have a due date. For each client, I want to select the contract with the first following duedate after a given reference ...
Hanne DC's user avatar
0 votes
1 answer
89 views

I'm working on a Flask application using SQLAlchemy where I need to consistently sort URLs stored in a database. The goal is to have a consistent ordering of competitor URLs so that when comparing ...
Marino's user avatar
  • 1
0 votes
4 answers
75 views

Given: -- INIT database CREATE TABLE Result ( ErrorCode INT ); INSERT INTO Result(ErrorCode) VALUES (500); INSERT INTO Result(ErrorCode) VALUES (-8000); INSERT INTO Result(ErrorCode) VALUES (-7777);...
hyankov's user avatar
  • 4,136
-1 votes
1 answer
55 views

Id Child_one_id Child_two_id Parent_id 1 2 3 null 2 null null 1 3 2 null 1 4 null null null 5 6 7 null 6 null null 5 7 6 null 5 8 null null null 9 null null null 10 11 12 null 11 null null 10 12 null ...
Karthikeyan Sankar's user avatar
0 votes
3 answers
58 views

I get different sorting results when trying the same select on two different clients. This is a simple example: select 'CPSC' from dual union select 'C1' from dual order by 1 asc I get 'CPSC' first, ...
miran213's user avatar
1 vote
1 answer
74 views

I need some help sorting data by Included data. In the example below, I am returning a purchase order where I want to sort the purchase order line items by the line item id. return await context....
michael's user avatar
  • 35
1 vote
2 answers
41 views

I have simple table of Time and Task columns where it is ordered by Time and has associated task to it as per below example. Question: How to group the tasks and get the earliest time of every time ...
Avia Portal's user avatar
0 votes
1 answer
148 views

I need to replicate the exact order produced by another program that used the ORDER BY clause in its SQL query: SELECT Name FROM TABLE_NAME ORDER BY Name Result: To reproduce the order on my side, ...
user23787413's user avatar
1 vote
1 answer
262 views

I want to use SELECT WITH ROLLUP in MariaDB to get a summary row in the result set, but also order the remaining rows by SUM() DESC. How to best achieve this? Using the example from the linked ...
Eugene Yarmash's user avatar
1 vote
0 answers
57 views

I tried to write belowed SQL with CriteriaAPI in Hibernate 6.2.6: select foo.id, foo.bar, bar.name from foo left join bar on bar.code = foo.bar order by bar.name; This is my kotlin code:...
dtadescu's user avatar
1 vote
0 answers
67 views

I am trying to orderby value of a Map that is included in my @Entity as @CollectionTable @ElementCollection. I try to do this using criteriabuilder and eclipselink. I provide below the entity example @...
geminal's user avatar
  • 29
0 votes
1 answer
47 views

My written query is:- Query 1: SELECT CONCAT( "There are a total of " ," ", COUNT(OCCUPATION) ," ", LOWER(OCCUPATION) , "s." ) AS ENT FROM OCCUPATIONS GROUP BY ...
drrracula's user avatar
0 votes
0 answers
49 views

I need help to find out why this behaviour (not a solution). It's about the ORDER BY clause in SQL Server. It has nothing to do with the related post, because my case it's not about case sensitive/...
plionut's user avatar
  • 19

1
2 3 4 5
155