|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
hi everyone,
I have a huge table of URL's and need to sort them out by Top 10 Clicked!!! URL ------- http://www.google.at http://www.yahoo.com http://forums.devshed.com http://www.google.at http://www.google.at http://forums.devshed.com http://forums.devshed.com http://forums.devshed.com http://forums.devshed.com http://forums.devshed.com . . . . I much appreciate any help on this one!! sara Last edited by sara_ca : February 25th, 2004 at 08:49 PM. Reason: spelling error |
|
#2
|
||||
|
||||
|
Well, I'm guessing that your table also has a field that keeps track of the number of times the link was clicked then.
If so, your query should look something like this: SELECT linkAddress, linkClicks FROM linkTable ORDER BY linkClicks If you only want to return the top ten, add LIMIT 10 to the end. SELECT linkAddress, linkClicks FROM linkTable ORDER BY linkClicks LIMIT 10 Let me know if this is not what you need.
__________________
Mark Pearce |
|
#3
|
|||
|
|||
|
...I do not have that field, I am supposed to count them first somehow, and then list 10 most visited URL's...
Thanks for your fast reply!!! |
|
#4
|
|||
|
|||
|
...it is a log file and has bunch of other info (e.g. date, time ...), but my selection is based on URL only.
Thanks! |
|
#5
|
||||
|
||||
|
Sorry, I misunderstood.
So, this is a MSSQL table with a URL field, and fields for the other items? Or is there just one field with everything separated by commas or something? Also, are all the urls simple like the ones in your example, or could they be more complex like: http://forums.devshed.com/memberlist.php http://forums.devshed.com/faq.php http://forums.devshed.com/archive/ If so, would all the ones above be considered the same, or would they each be counted separately? |
|
#6
|
|||
|
|||
|
yes, soeme are very complex : (
|
|
#7
|
|||
|
|||
|
is it possible to DISTINCT this URL table, set up a counter for each DIST. record and string compare? am I overcomplicating???
|
|
#8
|
||||
|
||||
|
you could build take the first part of the URL and use it to count, something like:
http://www.mydomain.com/something... cutting between // and the next /
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
|
#9
|
|||
|
|||
|
Well I did manage to process this table, my SELECT stat's look rather funny, but I am getting results that I wanted
Thanks for all your help and references, sara_ca. |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > sorting URL's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|