Solved

select statements

Posted on 2011-03-20
2
263 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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

734 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