Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grouping information, How?
Message
From
03/11/1999 10:20:03
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Other
Title:
Grouping information, How?
Miscellaneous
Thread ID:
00286144
Message ID:
00286144
Views:
69
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
Next
Reply
Map
View

Click here to load this message in the networking platform