none
insert one table data into without existinng table RRS feed

  • Question

  • I have select query 

    below


    select  SUM( GenderId) as total ,GenderMaster.Gender,atte.totalAttendance from StudEnroll
    inner join StudMaster on StudEnroll.StudId=StudMaster.StudId
    left join 
    (select  SUM(GenderId)as totalAttendance,GenderMaster.Gender,StudEnId from StudEnroll
    inner join StudMaster on StudMaster.StudId=StudEnroll.StudId
    inner join StudAttendance on StudEnroll.CardId=StudAttendance.CardId
    inner join GenderMaster on GenderMaster.GenderId=StudMaster.Gender
    where YEAR=1 and StudAttendance.nowday='2014-10-10'
    group by GenderMaster.Gender,StudEnId
    )
     as atte on atte.StudEnId=StudEnroll.StudEnId
    inner join GenderMaster on GenderMaster.GenderId=StudMaster.Gender
    --left join StudAttendance on StudAttendance.CardId=StudEnroll.CardId
    where Year =1
    --  and totalAttendance is not null
    group by GenderMaster.Gender ,totalAttendance

    This query result store into without existing table 

    Wednesday, October 22, 2014 8:10 AM

All replies