Solved

sql help needed

Posted on 2001-09-14
3
278 Views
Last Modified: 2006-11-17
I have a table with about 5 million records in it.  I need to find the unique values of a field called URL and the number of times these specific URLs appear in my table.

For example:

URL               id
----------------------------
www.yahoo.com      1
www.lycos.com      2
www.yahoo.com      3

I need a report for the above data to return:

www.yahoo.com   2
www.lycos.com   1


Thanks!
0
Comment
Question by:kmurphy99
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
OlegP earned 50 total points
ID: 6482652
select url,count(url)
from table
group by url
0
 
LVL 6

Expert Comment

by:OlegP
ID: 6482669
With order

select url,count(url)
from table
group by url
order by count(url) desc
0
 

Author Comment

by:kmurphy99
ID: 6482723
Thanks!  New to this stuff....
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Trouble connecting to SqlServer database 4 62
Unrecognized Database Format 8 108
Distinct values from all columns in a table?? PL SQL 4 38
error in my cursor 5 33
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question