我有三张表他们的关系分别是主表StudentInfo(stuId,stuNo,StuName,stuPwd其中stuid是主键),外表PunishInfo(pinfoId,StuId,PtId,PinfoTime(时间),pinfoNumber(次数)其中PinfoId是主键),它和另一张表 punishType(ptId,ptName(类型值),ptOrder(类型))值主外键关系(PunishInfo主表,punishType外键)现在我要查询SutdentInfo表中的stuNo,StuName,PunishInfo中的PinfoTime,PinfoNumber,punishType表中的ptName,ptOrder并根据ptOrder或者ptOrder分组
帮帮忙嘛。。各位哥哥。姐姐些最好用存储过程谢谢
|