Solved

select statements

Posted on 2011-03-20
2
271 Views
Last Modified: 2012-05-11
From a table that contains user logs i need to get info from two columns: contain client_id and log_description.

The user_id column is a 4 word column.
The log description column contains alot of user activity listed in separate rows (including: time logged on, server connected to, IP address, connect/disconnect, action carried out, etc)

how can i find out users (userID column) that have connected and disconnected (log_description column) more than 10 times?

i believe i need to filter the log_description column to search for keywords (%connect% / %disconnect%) and associate that with the userid column. then display results as # of connections.

Please advice.
0
Comment
Question by:B0b_shiska
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
JoeNuvo earned 500 total points
ID: 35177745
SELECT userID 
FROM UserLog with (nolock)
WHERE log_description like '%connect%' 
-- disconnect already part of %connect%, do we don't need to mention it
GROUP BY userID
HAVING COUNT(*) > 10

Open in new window

0
 
LVL 32

Expert Comment

by:awking00
ID: 35182806
Can you provide some sample data and the expected output?
0

Featured Post

Myth Busting: MongoDB Scalability (it scales!)

I was talking with one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. He mentioned to me that several customers have been telling him that “MongoDB doesn’t scale!” MongoDB’s scalability was in question?

My response was, “Is that a joke?"

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

623 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