sql-order-by Questions
2
Solved
I can't figure out how to order by a column that is in my included model. But I'm not even returning that field in the attributes. I just want to order by it if that is possible. Or I can return it...
Jerboa asked 12/12, 2020 at 17:11
7
Solved
Need to "tie" UPDATE with ORDER BY. I'm trying to use cursors, but get the error:
cursor "cursupd" doesn't specify a line,
SQL state: 24000
Code:
BEGIN;
DECLARE cursUpd CURS...
Blooded asked 24/5, 2013 at 13:19
9
Solved
Here's the query (the largest table has about 40,000 rows)
SELECT
Course.CourseID,
Course.Description,
UserCourse.UserID,
UserCourse.TimeAllowed,
UserCourse.CreatedOn,
UserCourse.PassedOn,
...
Galah asked 19/5, 2009 at 19:43
2
Solved
I am using following query to query DB which have order by on two columns.
SELECT a,b,c from Table1 Order By a asc, b asc;
My question is, Is the sorting guaranteed to be stable (by Standards)...
Haplosis asked 20/3, 2013 at 11:51
10
I’m attempting to order by a number column in my database which has values 1-999
When I use
ORDER_BY registration_no ASC
I get….
1
101
102
103
104
105
106
107
108
109
11
110
Etc…
So it appe...
Furculum asked 13/5, 2013 at 10:18
5
I've created a sql view and I need to sort the results of select by using the ORDER BY on 4 fields, but I'm getting message that ORDER BY cannot be used in views unless I use TOP.
Can someone expla...
Erskine asked 6/1, 2010 at 0:51
9
Solved
I have a table and data like this:
ID | Name | Group
1 | Apple | A
2 | Boy | A
3 | Cat | B
4 | Dog | C
5 | Elep | C
6 | Fish | C
and I wish to order it according to the count of items in group fro...
Perceptible asked 3/3, 2012 at 11:12
6
Solved
I have a database with an Items table that looks something like this:
id
name
category (int)
There are several hundred thousand records. Each item can be in one of 7 different categories, which ...
Druci asked 9/1, 2013 at 19:49
4
Solved
Lets say I have a plant table:
id fruit
1 banana
2 apple
3 orange
I can do these
SELECT * FROM plant ORDER BY id;
SELECT * FROM plant ORDER BY fruit DESC;
which does the obvious thing.
But I...
Meaghanmeagher asked 27/10, 2012 at 10:23
14
Solved
After executing the following statement:
SELECT Category FROM MonitoringJob ORDER BY CreationDate DESC
I am getting the following values from the database:
test3
test3
bildung
test4
test3
test2...
Isis asked 22/3, 2011 at 12:55
6
Solved
I have a generic
List<MyClass>
where MyClass has a property InvoiceNumber which contains values such as:
200906/1
200906/2
..
200906/10
200906/11
200906/12
My list is bound to a
Binding...
Pileate asked 12/6, 2009 at 8:49
3
I would like to have a collection of child objects (here cat-kitten example) that are ordered. And keep their order on adding of new elements.
@Entity
public class Cat {
@OneToMany(mappedBy = &qu...
Controvert asked 9/11, 2013 at 2:37
5
Solved
I have a search form which searches a site content table to pull back appropriate results.
I want to search the title and content fields and pull back results in order of relevance. Giving highest...
Bouzoun asked 22/2, 2013 at 14:19
15
Solved
I have a SQL table with a datetime field. The field in question can be null. I have a query and I want the results sorted ascendingly by the datetime field, however I want rows where the datetime f...
Leninakan asked 30/9, 2009 at 14:56
3
Solved
I use Cosmos Db and I need results to be sorted by the results of a COUNT.
Instead of sorting the results each time myself (or create a service for it), I prefer having the results sorted directl...
Yasminyasmine asked 21/11, 2019 at 10:59
5
Solved
Using Microsoft SQL server manager 2008.
Making a stored procedure that will "eventually" select the top 10 on the Pareto list. But I also would like to run this again to find the bottom 10.
Now,...
Sonnier asked 13/9, 2012 at 13:19
2
Solved
In my application, I am using MySQL and typeorm and want to do orderBy using multiple columns. I searched so many places for it but did not get any solution.
Example:
I have two columns in a table ...
Tripody asked 4/11, 2020 at 13:55
4
Solved
In a MySQL query, when using the DISTINCT option, does ORDER BY apply after the duplicates are removed? If not, is there any way to make it do so? I think it's causing some issues with my code.
ED...
Fiery asked 5/6, 2012 at 21:10
6
In my database I have some records where I am sorting by a column that contains identical values:
| col1 | timestamp |
| row1 | 2011-07-01 00:00:00 |
| row2 | 2011-07-01 00:00:00 |
| row3 | 2011-07...
Atween asked 12/7, 2011 at 10:35
13
Solved
I'm stuck on a simple task.
I just need to order results coming from this call
$results = Project::all();
Where Project is a model. I've tried this
$results = Project::all()->orderBy("name...
Chicky asked 2/7, 2013 at 15:18
13
Solved
There are plenty of similar questions to be found on here but I don't think that any answer the question adequately.
I'll continue from the current most popular question and use their example if t...
Creighton asked 8/2, 2013 at 10:38
2
Solved
I have a method in a webservice that has parameter with which users can decide how they want to order their results. This is a List(Of String) with the names of the fields in the order they want to...
Terra asked 11/5, 2012 at 13:4
6
Solved
ActionView::Template::Error (PG::Error: ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
I'm creating an events website and I'm trying to sort the rendered rsvps by t...
Creature asked 2/10, 2012 at 15:11
8
Solved
I want to order by Time,but seems no way to do that ?
mysql> show processlist;
+--------+-------------+--------------------+------+---------+--------+----------------------------------+--------...
Pharmacopoeia asked 30/5, 2009 at 11:53
4
Solved
How can I order DESC by a field, but list the NULL values first?
So I'm having a table:
reuestId | offerId | offerTitle
1 | 1 | Alfa
NULL | 2 | Beta
2 | 3 | Gamma
I want to select them so that ...
Navarra asked 16/2, 2012 at 8:8
1 Next >
© 2022 - 2025 — McMap. All rights reserved.