Connecting Tech Pros Worldwide Help | Site Map

Distinct Row based on description count

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 29th, 2008, 08:05 PM
eighthman11
Guest
 
Posts: n/a
Default Distinct Row based on description count

Hello everyone.

Hope someone can help. I have a table with two columns Material
Number and Material Description. Sample data below:

Material# Description
10000 This is item 10000
10000

  #2  
Old July 29th, 2008, 08:25 PM
Roy Harvey (SQL Server MVP)
Guest
 
Posts: n/a
Default Re: Distinct Row based on description count

On Tue, 29 Jul 2008 13:04:32 -0700 (PDT), eighthman11
<rdshultz@nooter.comwrote:
Quote:
>Hello everyone.
>
>Hope someone can help. I have a table with two columns Material
>Number and Material Description. Sample data below:
>
>Material# Description
>10000 This is item 10000
>10000
I see that you started to try to ask a question in the Subject, but it
is not at all clear (to me at least) what you are asking for. Perhaps
you can be a bit more specific.

Roy Harvey
Beacon Falls, CT
  #3  
Old July 29th, 2008, 08:35 PM
Plamen Ratchev
Guest
 
Posts: n/a
Default Re: Distinct Row based on description count

It is not clear what you need, but maybe this:

SELECT material_nbr, MAX(description) AS material_description
FROM Materials
GROUP BY material_nbr;


Plamen Ratchev
http://www.SQLStudio.com
  #4  
Old July 29th, 2008, 09:25 PM
--CELKO--
Guest
 
Posts: n/a
Default Re: Distinct Row based on description count

Please post DDL, so that people do not have to guess what the keys,
constraints, Declarative Referential Integrity, data types, etc. in
your schema are. If you know how, follow ISO-11179 data element naming
conventions and formatting rules. Sample data is also a good idea,
along with clear specifications. It is very hard to debug code when
you do not let us see it.

What you did post used #, which will screw up your data dictionary
when you try to put that data element name on the Internet,
"description" of what? etc.

Then you never finished asking a question in the posting. This is too
vague to be considered seriously.

If you want to learn how to ask a question on a Newsgroup, look at:
http://www.catb.org/~esr/faqs/smart-questions.html

  #5  
Old August 2nd, 2008, 08:35 AM
Erland Sommarskog
Guest
 
Posts: n/a
Default Re: Distinct Row based on description count

eighthman11 (rdshultz@nooter.com) writes:
Quote:
Hope someone can help. I have a table with two columns Material
Number and Material Description. Sample data below:
>
Material# Description
10000 This is item 10000
10000
Looks like you pressed the Send button too quickly?

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.