Results 1 to 3 of 3

Thread: Need a help

  1. #1
    Join Date
    Dec 2012

    Unanswered: Need a help

    can anyone tell me a solution. I have 4 tables are connected togather note,teacher,student,class

    note table has note id, student id, teacher id , note_req,school_date.
    teacher table has, teacher_id,teacher_name
    student table has student_id,student_name
    class has class_id,note id, student id, teacher id. date_of_class

    1. I have inserted values into 3 tables which are student, teacher and note
    2. I want to know how to insert same values which are primiry keys into class tables and if note_req = 'YES' insert a date value into date_of_class
    the date_of_class must be school_day +90 days

    I hope you understand what I am writting

  2. #2
    Join Date
    Aug 2003
    Where the Surf Meets the Turf @Del Mar, CA
    Provided Answers: 1
    post CREATE statement for all 4 tables
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Feb 2006
    Provided Answers: 1
    can anyone tell me a solution.
    We don't know all your details, table layouts, foreign keys, how you generate the new keys, etc..
    Anyway, below is an example:

    insert into class
      select ( your class_id, probably a sequence), note_id, student_id, teacher_id,
               when note_req  =  'YES' then school_date + 90
               else null
             end ) as date_of_class
       from  note

Posting Permissions

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