By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,251 Members | 2,764 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,251 IT Pros & Developers. It's quick & easy.

Consolidate repetitive data into just one name each

P: 2
Hello I have a table that lists its component name and its value several times each but with different values each time then goes onto the next component and so on. I want to create a query that will just display the components name once and not each time its used in the table. Below is the sql...
Expand|Select|Wrap|Line Numbers
  1. SELECT tbl_ComponentVar.ComponentName
  2. FROM tbl_ComponentVar
  3. ORDER BY tbl_ComponentVar.ComponentName;
CutOffBlades
CutOffBlades
CutOffBlades
CutOffBlades
CutOffBlades
FeedWheel
FeedWheel
FeedWheel
FeedWheel
FeedWheel
Bearing1
Bearing1
Bearing1
Bearing1
Bearing1
2 Weeks Ago #1
Share this Question
Share on Google+
4 Replies


100+
P: 161
Have you tried doing a group by?
2 Weeks Ago #2

P: 2
I figured it out, I used Distinct at the beginning of the query...

CutOffBlades
Bearing1
FeedWheel
2 Weeks Ago #3

twinnyfo
Expert Mod 2.5K+
P: 3,257
@DJ,

Hey buddy! You're starting to give advice now! Good to see you thinking about solutions for others, too!

Great to have you on the forum!
2 Weeks Ago #4

NeoPa
Expert Mod 15k+
P: 31,433
Either approach can work. They're different and each has its pros & cons.

A quick check in the help system would have given both answers (Finding Jet SQL Help may be worth using in future as a first step. Obviously it works in the same way for ACE which replaced Jet when 2007 came out with the new ACCDB format).
23 Hours Ago #5

Post your reply

Sign in to post your reply or Sign up for a free account.