distinct Questions
4
Solved
How do I make MySQL's SELECT DISTINCT case sensitive?
create temporary table X (name varchar(50) NULL);
insert into X values ('this'), ('This');
Now this query:
select distinct(name) from X;
...
Diggs asked 19/10, 2013 at 5:59
5
Solved
I can perform the following SQL Server selection of distinct (or non-repeating names) from a column in one table like so:
SELECT COUNT(DISTINCT [Name]) FROM [MyTable]
But what if I have more tha...
Bit asked 15/7, 2011 at 19:19
6
Solved
I'm using the STRING_AGG function in SQL Server 2017. I'd like to create the same effect as COUNT(DISTINCT <column>). I tried STRING_AGG(DISTINCT <column>,',') but that is not legal syn...
Orthography asked 2/8, 2018 at 5:52
10
Solved
I have a table with >1M rows of data and 20+ columns.
Within my table (tableX) I have identified duplicate records (~80k) in one particular column (troubleColumn).
If possible I would like to ret...
Oxbow asked 17/4, 2016 at 10:47
12
How can I use the DISTINCT clause with WHERE? For example:
SELECT * FROM table WHERE DISTINCT email; -- email is a column name
I want to select all columns from a table with distinct email addre...
Operand asked 10/4, 2011 at 8:11
8
I need to create a list with one billion integers and they must all be unique. I also need this to be done extremely fast.
Creating a list and adding random numbers one by one and checking to see ...
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
5
Solved
I've been using PostgreSQL and now migrating to MySQL.
In my queries, I'm using PostgreSQL's SELECT DISTINCT ON (col1, col2, col3), I was wondering if there is any counterpart of this statement i...
Relativity asked 16/7, 2013 at 9:56
4
I'm looking for a formula calculating : distinct Count + multiple criteria
Countifs() does it but do not includes distinct count...
Here is an example.
I have a table on which I want to count the...
Holston asked 23/6, 2016 at 12:47
14
Solved
So I'm trying to get the number of distinct pids on a query, but the returned value is wrong.
This is what I try to do:
$ad->getcodes()->groupby('pid')->distinct()->count()
what ret...
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'm looking for a way to do the equivalent to the SQL
SELECT DISTINCT col1, col2 FROM dataframe_table
The pandas sql comparison doesn't have anything about distinct.
.unique() only works for a...
Yalonda asked 29/5, 2015 at 13:17
8
Solved
I have a Google spreadsheet with a column that looks like this:
City
----
London
Paris
London
Berlin
Rome
Paris
I want to count the appearances of each distinct city (so I need the city name and...
Famish asked 17/1, 2013 at 14:7
6
Solved
TABLE quotation
id clientid
1 25
2 25
3 25
4 25
5 26
How can I query how many different clients exist in TABLE quotation? I don't want duplicate entries to be counted more than once.
I need the...
14
Solved
I can select all the distinct values in a column in the following ways:
SELECT DISTINCT column_name FROM table_name;
SELECT column_name FROM table_name GROUP BY column_name;
But how do I get th...
9
Solved
Short question:
Is there a simple way in LINQ to objects to get a distinct list of objects from a list based on a key property on the objects.
Long question:
I am trying to do a Distinct() operatio...
9
Solved
How can I do this SQL query with Entity Framework?
SELECT DISTINCT NAME FROM TestAddresses
Cabalist asked 27/12, 2010 at 15:24
3
I'm using the simple command: SELECT DISTINCT * FROM first_working_table; in HIVE 0.11, and I'm receiving the following error message:
FAILED: SemanticException TOK_ALLCOLREF is not supported in...
23
Solved
I am playing with LINQ to learn about it, but I can't figure out how to use Distinct when I do not have a simple list (a simple list of integers is pretty easy to do, this is not the question). Wha...
Bovid asked 28/1, 2009 at 20:45
8
Solved
I have the following item set from an XML:
id category
5 1
5 3
5 4
5 3
5 3
I need a distinct list of these items:
5 1
5 3
5 4
How can I distinct for Category AND Id too in LINQ?
3
My query is below:
select
u.Id,
STRING_AGG(sf.Naziv, ', ') as 'Ustrojstvena jedinica',
ISNULL(CONVERT(varchar(200), (STRING_AGG(TRIM(p.Naziv), ', ')), 121), '')
as 'Partner',
from Ugovor as...
Markova asked 26/2, 2018 at 9:59
5
models.py
class SinglePoint(models.Model):
attributes = models.TextField(blank=True)
name = models.CharField(max_length=100)
geom = models.PointField() #Kartenposition
objects = models.GeoManag...
Pairoar asked 14/7, 2009 at 14:37
2
Solved
Say you have this:
class LogEntry
{
int ID;
int UserName;
datetime TimeStamp;
string Details;
}
and you have pulled a set of data like this:
ID Username Timestamp Details
1 foo 1/01/2010 Ac...
19
Solved
SELECT DISTINCT field1, field2, field3, ......
FROM table;
I am trying to accomplish the following SQL statement, but I want it to return all columns.
Is this possible?
Something like this:
SELECT...
5
I have a very simple SQL query:
SELECT COUNT(DISTINCT x) FROM table;
My table has about 1.5 million rows. This query is running pretty slowly; it takes about 7.5s, compared to
SELECT COUNT(x) ...
Rule asked 28/6, 2012 at 17:52
1 Next >
© 2022 - 2025 — McMap. All rights reserved.