CREATE PROCEDURE `spGetUserById` ( `P_UserID` INTEGER , `P_InstituteId` INTEGER ) BEGIN DECLARE `roleid` INTEGER ; SET `roleid` = ( SELECT `roletypeid` FROM `tuser` WHERE `id` = `P_UserId` ) ; IF ( `roleid` = ? ) THEN SELECT `tuser` . `id` AS `UserId` , `ifnull` ( `tuser` . `Name` , ? ) AS `UserName` , `tuser` . `roletypeid` AS `RoleTypeId` , `tuser` . `MobileNo` AS `MobileNo` , `tstudent` . `id` AS `StudentId` , `ifnull` ( `tstudent` . `code` , ? ) AS `StudentCode` , `ifnull` ( `tstudent` . `EmailId` , ? ) AS `EmailId` , `tstudent` . `rollno` AS `RollNo` , CAST ( `tstudent` . `DateofBirth` AS CHARACTER ) AS `DateOfBirth` , `tstudent` . `GenderId` AS `GenderId` , `ifnull` ( `tgendermaster` . `Title` , ? ) AS `GenderTitle` , `tstudent` . `BloodGroupId` AS `BloodGroupId` , `ifnull` ( `tbloodgroupmaster` . `Title` , ? ) AS `BloodGroupTitle` , `ifnull` ( `tstudent` . `AadharCardNumber` , ? ) AS `AadharCardNumber` , CAST ( `tstudent` . `DateOfJoining` AS CHARACTER ) AS `DateOfJoining` , `ifnull` ( `PermenantAddress` , ? ) AS `PermenantAddress` , 