Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Real easy question regardin what I can access

Status
Not open for further replies.

Hollymc

Vendor
Apr 18, 2005
7
CA
I inherited my company and all that came with it including the database.

I would love to be able to find what I have available to me.

I have two tables: Contacts, Transactions
within transactions I have Category1, category2, category3, etc..

Category1 is items, things like books, cake, flowers
category2 is types of items like, hardcover, wedding, roses
Category3 is descriptions of those items like, adult, chocolate, red,

How can I find everything that could be in there?

Thanks for any help
 
I am assuming you want to find out all categories you have? For starters you can try:

In which case use the distinct key word.
Code:
select distinct category1, category2, category3 from Transactions

You can also do some counts like
Code:
select category1, count(*)
from Transactions
group by category1

Check books online which comes with sql server (click f1 from query analyzer or download from and understand concepts of joins, group by, distinct etc.

Regards,
AA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top