Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Distinct Row based on description count

 
   Database Forums (Home) -> General Discussions RSS
Next:  multiple record output on a single spreadsheet li..  
Author Message
eighthman11

External


Since: Jul 29, 2008
Posts: 6



(Msg. 1) Posted: Tue Jul 29, 2008 1:04 pm
Post subject: Distinct Row based on description count
Archived from groups: comp>databases>ms-sqlserver (more info?)

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

 >> Stay informed about: Distinct Row based on description count 
Back to top
Login to vote
--CELKO--

External


Since: Apr 17, 2007
Posts: 417



(Msg. 2) Posted: Tue Jul 29, 2008 2:15 pm
Post subject: Re: Distinct Row based on description count [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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

 >> Stay informed about: Distinct Row based on description count 
Back to top
Login to vote
"Roy Harvey

External


Since: Sep 24, 2007
Posts: 167



(Msg. 3) Posted: Tue Jul 29, 2008 4:18 pm
Post subject: Re: Distinct Row based on description count [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Tue, 29 Jul 2008 13:04:32 -0700 (PDT), eighthman11
wrote:

>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
 >> Stay informed about: Distinct Row based on description count 
Back to top
Login to vote
Plamen Ratchev

External


Since: Nov 06, 2007
Posts: 352



(Msg. 4) Posted: Tue Jul 29, 2008 4:31 pm
Post subject: Re: Distinct Row based on description count [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
 >> Stay informed about: Distinct Row based on description count 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 1649



(Msg. 5) Posted: Sat Aug 02, 2008 8:18 am
Post subject: Re: Distinct Row based on description count [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

eighthman11 (rdshultz@nooter.com) writes:
> 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.DeleteThis@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 >> Stay informed about: Distinct Row based on description count 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
SQL Counting number of non-distinct rows? - Hi, I have a table that for ease has this data in: R1, R2, R....z --------------------- A | 12 A | 22 A | 30 B | 0 B | -1 B | -3 C | 100 I want to generate a table for each distinct row in R1, gives a count of all the rows with data corresponding For....

MSSQL - DTS Package - Find distinct rows - Output to TXT f.. - Hello All, I am trying to create a DTS package. I have two tables tbl_A and tbl_B with similar data/rows but no primary keys. tbl_A is master. I would like this package to query tbl_A and tbl_B and find 1)all rows in tbl_A that are different in tbl_B,....

MSSQL - DTS Package - Find distinct rows - Output to TXT f.. - Hello All, I am trying to create a DTS package. I have two tables tbl_A and tbl_B with similar data/rows but no primary keys. tbl_A is master. I would like this package to query tbl_A and tbl_B and find 1)all rows in tbl_A that are different in tbl_B,....

Getting count with multiple fields - Hi all, I'm running into a road block, and I know I've done this before. I'm getting fields from two tables, and I need to do a count of similar items with it showing some extra info. Here's my fields: Log.LogId - Int Log.LogDispatcherID - Int..

Count from detail table - Hi I've two tables TableA id name TableB id tableA_id desc oper As you can see tableA is a master and tableB is a detail table where we can have many records for each related tableA record. I need to get all records for tableA with a..
   Database Forums (Home) -> General Discussions All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]