Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

stupid "SELECT" :-(...
Hi

I have a table like that:
      addr_ip       date
      127.0.0.1    20050512140758 
      127.0.0.1    20050512143522 
      127.0.0.1    20050512143710 
      127.0.0.1    20050512203349 
      24.60.19.142 20050512203407 
      24.60.19.142 20050512203409 
      24.60.19.142 20050512203409 
      127.0.0.1    20050512215434 
      24.60.19.142 20050512215451 
      127.0.0.1    20050512225606 
      127.0.0.1    20050512225617 
      24.60.19.142 20050512225712 

And I would like a result like this:
addr_ip   date           min( sup.date)
127.0.0.1 20050512140758 20050512143522 
127.0.0.1 20050512143522 20050512143710 
127.0.0.1 20050512143710 20050512203349 
127.0.0.1 20050512203349 20050512203407 
127.0.0.1 20050512215434 20050512215451 w
127.0.0.1 20050512225606 20050512225617 w
127.0.0.1 20050512225617 20050512225712 w
24.60.19.142 20050512203407 20050512203409 
24.60.19.142 20050512203409 20050512215434 w
24.60.19.142 20050512215451 20050512225606 w

As you see I'm trying to write in one record the interval of 2 following pos
itions for the same @IP. I tried this after hours of efforts but it doesn't 
work well:
SELECT tab.addr_ip, tab.date, min( sup.date ) 
FROM visit tab, visit sup
WHERE tab.date < sup.date
GROUP BY tab.date
ORDER BY tab.addr_ip, tab.date

Do you have any other solution, sources that would help me?

Nick
Thanks.

Report this thread to moderator Post Follow-up to this message
Old Post
nicolasd92
05-13-05 06:35 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP SQL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:34 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.