SunQuest
           MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Try It Free
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 25th, 2004, 08:40 PM
sara_ca sara_ca is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 8 sara_ca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy sorting URL's

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

Reply With Quote
  #2  
Old February 25th, 2004, 08:56 PM
mpearce's Avatar
mpearce mpearce is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: NewHampshire, USA
Posts: 416 mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 30 m 44 sec
Reputation Power: 9
Send a message via AIM to mpearce
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

Reply With Quote
  #3  
Old February 25th, 2004, 09:25 PM
sara_ca sara_ca is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 8 sara_ca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
...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!!!

Reply With Quote
  #4  
Old February 25th, 2004, 09:33 PM
sara_ca sara_ca is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 8 sara_ca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
...it is a log file and has bunch of other info (e.g. date, time ...), but my selection is based on URL only.

Thanks!

Reply With Quote
  #5  
Old February 25th, 2004, 10:54 PM
mpearce's Avatar
mpearce mpearce is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Location: NewHampshire, USA
Posts: 416 mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level)mpearce User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 19 h 30 m 44 sec
Reputation Power: 9
Send a message via AIM to mpearce
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?

Reply With Quote
  #6  
Old February 26th, 2004, 12:56 AM
sara_ca sara_ca is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 8 sara_ca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes, soeme are very complex : (

Reply With Quote
  #7  
Old February 26th, 2004, 01:02 AM
sara_ca sara_ca is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 8 sara_ca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
is it possible to DISTINCT this URL table, set up a counter for each DIST. record and string compare? am I overcomplicating???

Reply With Quote
  #8  
Old February 26th, 2004, 03:35 AM
pabloj's Avatar
pabloj pabloj is offline
Modding: Oracle MsSQL Firebird
Dev Shed God 6th Plane (7500 - 7999 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 7,707 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 2 Weeks 6 Days 2 h 38 m 50 sec
Reputation Power: 259
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 /

Reply With Quote
  #9  
Old February 26th, 2004, 04:49 AM
sara_ca sara_ca is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 8 sara_ca User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > sorting URL's


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway