Hi all
I hope I can explain what I am trying to do here....
I am trying to create a statement where it will return the UNIQUE values
from a table, I think its the UNIQUE statment.
So a table may have 60 entries, 20 of them are X, 20 Y and 20 Z
I want it to return only X,Y,Z e.g. 3 returned entries.
How do I do this?
Brian 4 1329
"Brian" <br***@nrwp.co.uk> wrote in message
news:XDBnc.838$Ne7.815@newsfe1-win... I hope I can explain what I am trying to do here.... I am trying to create a statement where it will return the UNIQUE values from a table, I think its the UNIQUE statment. So a table may have 60 entries, 20 of them are X, 20 Y and 20 Z I want it to return only X,Y,Z e.g. 3 returned entries.
How do I do this?
select distinct value
from tablename;
Note this one too
select count(distinct value)
from tablename;
"Brian" <br***@nrwp.co.uk> wrote in message
news:XDBnc.838$Ne7.815@newsfe1-win... I hope I can explain what I am trying to do here.... I am trying to create a statement where it will return the UNIQUE values from a table, I think its the UNIQUE statment. So a table may have 60 entries, 20 of them are X, 20 Y and 20 Z I want it to return only X,Y,Z e.g. 3 returned entries.
How do I do this?
select distinct value
from tablename;
Note this one too
select count(distinct value)
from tablename;
Thats the one !!! Thanks :) I hope I can explain what I am trying to do here.... I am trying to create a statement where it will return the UNIQUE values from a table, I think its the UNIQUE statment. So a table may have 60 entries, 20 of them are X, 20 Y and 20 Z I want it to return only X,Y,Z e.g. 3 returned entries.
How do I do this?
select distinct value from tablename;
Note this one too
select count(distinct value) from tablename;
Thats the one !!! Thanks :) I hope I can explain what I am trying to do here.... I am trying to create a statement where it will return the UNIQUE values from a table, I think its the UNIQUE statment. So a table may have 60 entries, 20 of them are X, 20 Y and 20 Z I want it to return only X,Y,Z e.g. 3 returned entries.
How do I do this?
select distinct value from tablename;
Note this one too
select count(distinct value) from tablename;
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: kevin parks |
last post by:
hi. I've been banging my head against this one a while and have asked
around, and i
am throwing this one out there in the hopes that some one can shed
some light on
what has turned out to be a...
|
by: Agoston Bejo |
last post by:
I want to enforce such a constraint on a column that would ensure that the
values be all unique, but this wouldn't apply to NULL values. (I.e. there
may be more than one NULL value in the column.)...
|
by: June Moore |
last post by:
Hi,
I would like to add a unique index that consists of two fields in a
table.
e.g. tbl_A (field1,field2) -- field1 & field2 Indexed and combination
must be Unique.
Can anyone tell me the...
|
by: Kamil |
last post by:
Hello
What should I use for better perfomance since
unique constraint always use index ?
Thanks
Kamil
|
by: Bob Stearns |
last post by:
I was under the impression that the primary key had to be a unique
index. Since I usually create my primary indices before my primary keys,
in order to get the indices in the same schema as their...
|
by: bwmiller16 |
last post by:
Guys -
I'm doing a database consistency check for a client and I find that
they're building unique indexes for performance/query reasons where
they could be using non-unique indexes.
Note...
|
by: aj |
last post by:
DB2 WSE 8.1 FP5
Red Hat AS 2.1
What is the difference between adding a unique constraint like:
ALTER TABLE <SCHEMA>.<TABLE> ADD CONSTRAINT CC1131378283225 UNIQUE (
<COL1>) ;
and adding a...
|
by: Brian Keating |
last post by:
Hi there,
Is it possible to add a unique constraint on two columns in a table, so that
the constraint is a composite of the two? i.e. these two columns together
should be unique...?
i.e....
|
by: Laurence |
last post by:
Hi there,
How to differentiate between unique constraint and unique index? These
are very similar but I cannot differentiate them?
Could someone give me a hand?
Thanks in advance
|
by: pstachy |
last post by:
Hi again!
I have another issue. I would like the attribute of the tag <invoice>
to be unique. Made the following schema but unfortunately it doesn't
validate. Could someone please indicate what is...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |