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

Thread: Help Needed

  1. #1
    Join Date
    May 2008
    Posts
    1

    Help Needed

    user634381 :


    Hi all,

    I require a query. My issue is:

    I have a table with 3 columns:

    1'st column stores the value through (Sun, Mon,..., Sat) : All 7 days of the week.
    2'nd Column stores Group_id like (1,2,...n)
    3'rd Column stores Batch id like (1,2,3,....n)

    Rows resemble like this:

    Sun 1 1
    Sun 1 4
    sun 1 5
    Sun 2 2
    sun 2 8
    Sun 2 9
    Mon 1 1
    Mon 1 4
    Mon 1 5
    Mon 2 2
    Mon 2 8
    Mon 2 9.
    .
    .
    Sat 2 9

    Conditions:
    1. The group and batch id is the same for all the days. Eg.
    Sun 1 1
    Sun 1 4
    sun 1 5
    Sun 2 2
    sun 2 8
    Sun 2 9
    Mon 1 1
    Mon 1 4
    Mon 1 5
    Mon 2 2
    Mon 2 8
    Mon 2 9

    My requirement is:

    1. I want to display the distinct batch ids of the list for all the days based on group like:
    1,4,5 and should not contain : 2,8,9
    Last edited by theyaga_82; 05-03-2008 at 08:52 AM.

  2. #2
    Join Date
    Mar 2007
    Location
    Ft. Lauderdale, FL
    Posts
    3,555
    Is that home work?
    ...would you mind in showing us your best effort?
    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