Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grouping information, How?
Message
De
03/11/1999 10:20:03
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Titre:
Grouping information, How?
Divers
Thread ID:
00286144
Message ID:
00286144
Vues:
68
Hello everyone!
I need some tips regarding how to get just a few records from a table, let me explaing...
I have a database called Categories, it has the following fields:
1) CATCOD, VAR(10)
2) CATDESCRIPTION, CHAR(20)
the look like this...
CatCod CatDescription
-----------------------------------
01000 Agriculture
01001 Agriculture - Plants
01002 Agriculture - Animals
02000 Automotives
02001 Automotives - parts
02002 Automotives - Dealers
03000 Travel
03001 Travel - Airplanes

My question is, how I could get just the 2 first code of CatCod and the CatDescription but not duplicating the CatCod, I want the next result:
CatCod CatDescription
-----------------------------------
01 Agriculture
02 Automotives
03 Travel

and upon try to use GROUP BY I don't get the result that I want.
Any sugestion please.
Thanks,

Gerardo
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform