473,378 Members | 1,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

complex SQL query

16
http://img100.imageshack.us/my.php?image=sqloi8.png

(please refer this first before proceeding)

I want a SQL query that satisfies the following results:-

Question# I want to count the rows where the client + server IP remain same over a particular # of entries like 10,20 and etc.
E.g 1-4 is a pattern where both client and server ip have remain same. I want a count of that.

Sub-Question# Secondly, i wanna retrieve only the most recent record .The pattern which was prevalent in the time b/w 12:22 to 1:00 is irrelevent i want the next query to execute with the current time.

I used SQLdata reader but it is being unable to retrieve
me the exact count i require due to inherent restriction that comes
with the scope of this method. I cannot use it DataGrid because
im using a command application(dos etc).

Please help me get over this..Thanks.
Oct 28 '07 #1
3 1228
debasisdas
8,127 Expert 4TB
I am not in habbit of opening each and every link that i come across in net.
Oct 29 '07 #2
zonar00
16
I am not in habbit of opening each and every link that i come across in net.
u must be kidding right..... i have posted the same link to other forums noone was probably as pessimistic as your are.
Oct 29 '07 #3
azimmer
200 Expert 100+
http://img100.imageshack.us/my.php?image=sqloi8.png

(please refer this first before proceeding)

I want a SQL query that satisfies the following results:-

Question# I want to count the rows where the client + server IP remain same over a particular # of entries like 10,20 and etc.
E.g 1-4 is a pattern where both client and server ip have remain same. I want a count of that.

Sub-Question# Secondly, i wanna retrieve only the most recent record .The pattern which was prevalent in the time b/w 12:22 to 1:00 is irrelevent i want the next query to execute with the current time.

I used SQLdata reader but it is being unable to retrieve
me the exact count i require due to inherent restriction that comes
with the scope of this method. I cannot use it DataGrid because
im using a command application(dos etc).

Please help me get over this..Thanks.
Would it be possible to modify the data structure? I mean the first thing I would need is a running count column for each row. Do you use 2005 or 2000? (2005 has a new RANK() function that can be used to this end w/o having to modify the data structure.) BTW: Does "Time" contain dates as well? (So that we can handle wrap-arounds.)

Then: I suppose from the nature of the data that ClientIP/ServerIP combinations can "come back" at a later time (i.e. the same IPs can be assigned after a while -- whereas in the meantime either or both are different). I also assume that separate counts are needed for each such run. Please, verify these assumptions.
Oct 30 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Starbuck | last post by:
OK, first let me say that I am no DB person. But I have a user here who keeps getting this error whenever she does, whatever it is she does, with databases... A google search takes me to...
2
by: Mikel | last post by:
I am trying to get around the problem "The expression you have entered is too complex" for a select query. (The example below is not the expression that is giving me headaches.) So I am thinking...
4
by: ED | last post by:
I am attempting to to write a query that has a numerous nested IIf statements. The problem that I am having is that it is to long of a query to be built in design mode and when I build it in sql...
8
by: Matt | last post by:
Hi all, Thank you for taking the time. I have a database with 45 tables on it. 44 tables are linked to a main table through a one to one relationship. My question is, is there no way i can...
2
by: Ben de Vette | last post by:
Hi, I'm using the querybuilder when updating a record in a table (Access). However, I get a "Query is too complex" message. The Primary key is autonumbered. Why is it making such a complex...
1
by: arun | last post by:
Query is too complex -------------------------------------------------------------------------------- Hi, I was trying to solve this problem since last two days but couldn't find any solution. ...
1
by: Randy Volkart | last post by:
I'm trying to fix a glitch in a complex access database, and have a fairly complex problem... unless there's some obscure easy fix I don't know being fairly new with Access. Basically, the area...
19
by: kawaks40 | last post by:
Hi everyone :) I just recently started using access/sql. and right away I ran into this problem "SQL expression too complex" I google'd a lot on what it means, and the only workaround I've...
3
by: Eric Davidson | last post by:
DB2 9.5 I keep geting the message. SQL0101N The statement is too long or too complex. SQLSTATE=54001 When one of my sql statements takes over 60 seconds to compile the sql statement. Is...
0
crystal2005
by: crystal2005 | last post by:
Hi, I am having trouble with some complex SQL queries. I’ve got winestore database, taken from Web Database Application with PHP and MySQL book. And some question about queries as the following ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.