Solved

select statements

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

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
In this article I will describe the Detach & Attach 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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now