SQL unique column
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: SQL unique column

  1. #1
    Join Date
    Sep 2008

    SQL unique column

    I've been scratching my head over this problem. Tried searching for a similar problem, but I can't seem to find one. So here it is:

    I have a table with 3 columns (timestamp, data1, data2)

    I want to select timestamp, data1 and data2 where timestamp is between 'now' and 'then', but where data2 is the result of timestamp between 'now + 1 seconds' and 'then + 1 seconds'.

    In other words, data1 is from 13:00 - 13:01, but data2 is from 13:01 - 13:02 if that makes any sence.

    I thought it would be a simple query, but I just can't figure out how to do it ;-\

    Any help or pointers as to how to solve this?

  2. #2
    Join Date
    Mar 2007
    Ft. Lauderdale, FL
    Why don't you show us what you have so far?

    You already wrote some kind of pseudo-code, just code it.
    Pablo (Paul) Berzukov

    Author of Understanding Database Administration available at amazon and other bookstores.

    Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width