Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2010
    Posts
    2

    Unanswered: problem retrieving data from oracle

    Helloo,
    i have a problem in querying tables. The structure of the tables are as follows:

    Effortentry(effort_id, effort_date)

    Activity_details(act_det_id, effort_id, activity_id, hours)

    Activity(activity_id, activity_name)


    now i want to fetch hours for the activity for each day and display in frontend week by week i.e for 7 days together as follows:
    i'll be passing the day1 and day7 of that week.

    activity_name day1 day2 day3 day4 day5 day6 day7
    acitivity1 5 6 6 6 6 1 1
    acitivity2 0 0 2 1 4 1 0
    acitivity3 0 6 1 2 0 0 1
    acitivity4 0 4 2 3 0 6 0
    acitivity5 5 2 1 6 7 0 1


    Day1, day2, day3... consist of hours for the respective activity.

    Please let me know how to go about.. i tried creating views.
    What will be the best way to do it.

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    Have a look at my article on pivot queries.

  3. #3
    Join Date
    Mar 2010
    Posts
    2
    ya got it.. thanks.

Posting Permissions

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