sql - MySQL JOIN and COUNT failure -
i have 2 tables in mysql database.
------------------------------------------------------------------------ |student: |name |neptunid |signature |sex | | ------------------------------------------------------------------------ |signature: |studentid |classid |start |end |startsig |endsig ------------------------------------------------------------------------
i have search given classid
, following information:
name of student (studentid=neptunid)
signature table student
startsig field necessary
sum of students per sex
i have tried following query, don't know, how define, sex field should counted (male/female).
select st.name,st.neptunid,st.signature,si.startsig student st join signature si on st.neptunid=si.studentid si.start<'$today' , si.end>'$today'
Comments
Post a Comment