473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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
Jul 29 '08 #1
4 1658
On Tue, 29 Jul 2008 13:04:32 -0700 (PDT), eighthman11
<rd******@nooter.comwrote:
>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
Jul 29 '08 #2
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
Jul 29 '08 #3
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

Jul 29 '08 #4
eighthman11 (rd******@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, es****@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
Aug 2 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Paxton | last post by:
Hi, I'm trying to display the total page views per page within a given date range, but the correct SQL is seemingly beyond me. I get the correct result with a straightforward Group By and Count...
4
by: Larry R | last post by:
I am trying to use XPath (XSLT 1.0), EXSLT 1.1 (.Net) to select the nodelist consisting of the 'top n' nodes. THe counter is the count of item/value. Using a traditional for-each logic, the...
2
by: RBohannon | last post by:
I'm using Access 2000 on Windows 2000. I have a DB of several exams and people who have taken them. I need to assign ranks to the people according to their scores (within each exam). I have...
17
by: keith | last post by:
I am trying to get a exact count of different distinct entries in an Access column. At first, I was trying to work with three columns, but I've narrowed it down to one to simplify it. I've searched...
1
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT...
2
by: pierrelap | last post by:
Hello, I need to code a query that: 1-counts the number of time two companies have been in a deal together 2-in the five years that preceded the deal Lead Participant DealDate AAA BBB ...
3
by: Mihir | last post by:
All, I have this table: ClientName City Ram Mumbai Ram Cochin Ram Mumbai Ram Bangalore Lakhan Mumbai
1
by: aps786 | last post by:
Hi, There is a table where I store ipaddress and user who logged in from that IP. I have a query to findout all ipaddresses, from where diff users had made request. stat ------------ ip...
3
by: alienz747 | last post by:
Hi, I have a query which is supposed to count distinct fields but it doesn't work properly. It does not count the unique values of the PayrollNumber. It counts all values. Any ideas why? Thanks....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.