Groups | Blog | Home
all groups > sql server clients > march 2006 >

sql server clients : Query Help - PLEASE


Robby
3/29/2006 11:06:12 PM
I am in need of a little help. I need to write a query to total up some
search results. Here is a same of the data.

l_id l_include l_path
664 test Support
665 test Support
666 test Support
667 test www
670 visio Support
671 patent Support
672 stencil visio Support
676 doc tech Support
677 doc tech www
684 backpack Support
685 fiber panel patch Support
686 fiber panel patch www
687 data ps2 signal video Support
688 c/port signals Support
689 doc tech Support

I need a query that will show the number of hits for each item under column
l_include for each of the unique paths. So for "TEST" I would need it to
look like:

Search word location of search number of searches
test Support 3
test www 1

For "doc tech" it would look like:
doc tech www 1
doc tech Support 2

If you could point me in the right direction I would greatly appreciate it.

Robby

Tom Cooper
3/30/2006 2:31:36 AM
For example

Select l_include As 'Search word',
l_path As 'location of search',
Count(*) As 'number of searches'
From <table>
Where l_include = 'test'
Group By l_include, l_path
Order By l_include, l_path

Tom

[quoted text, click to view]

AddThis Social Bookmark Button