E-mail Print PDF

Синтаксис SQL

1
2
SELECT DISTINCT column_name(s)
FROM table_name

Пример

There is a table "Persons":

P_IdLastNameFirstNameAddressCity
1 Hansen Ola Timoteivn 10 Sandnes
2 Svendson Tove Borgvn 23 Sandnes
3 Pettersen Kari Storgt 20 Stavanger

For this we use this query:

1
SELECT DISTINCT City FROM Persons

Query Result:

City
Sandnes
Stavanger

Comments

 
+7 #1 Шелест Константин 2010-10-28 22:07 Without repeating tuples cool ... Quote
 
 
-2 #2 Сергей С 2011-08-15 12:03 But how to choose and at the same time P_Id? Quote
 
 
-1 #3 AVK_Alex 2011-08-17 16:00
But how to choose and at the same time P_Id?

I think
P_Id, City FROM Persons
Quote
 
 
-3 #4 хуес два 2011-10-12 17:19 two hues Quote
 
 
-3 #5 три 2011-10-12 17:45 times two, then sit down and read the manual Quote
 
 
-3 #6 aperturer 2011-11-30 10:53
But how to choose and at the same time P_Id?

City, P_Id FROM Persons
Quote
 
 
0 #7 Iluha 2011-12-07 14:22 Quote
 
 
0 #8 SkyMan 2012-01-16 09:53
But how to choose and at the same time P_Id?





Quote
 

Authorization

Nice Ajax Poll

Which one of my extensions is the best?

Statistics

Translate

русскийitalianoDeutschEnglishLATVIANукраїнськаfrançaispolski
1

Advertisement