Solved

select statements

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

Edgartown IT Case Study

Learn about Edgartown's quest to ensure the safety and security of the entire town's employee and citizen data. Read the case study!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Stored Proc - Rewrite 42 72
Query for timesheet application 3 24
Current Month Filter in Visual Studio 10 38
SQL Query Syntax error after > 11 39
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

735 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