Click here to Skip to main content
14,695,329 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Below i Give Code of SQL When I Try to Distinct Value Then i Get Syntax Error So Please Help Me

What I have tried:

SELECT distinct * FROM (  
select  Tbl_Faculty.First_Name,Designation_Master.Designation_Description,Tbl_Course_Master.Course_Name,

      Tbl_Specialisation_Master.Specialisation_Name,FacultyQualification.PassingYr,
	  Tbl_Faculty.Date_Of_Birth

 from Tbl_Faculty inner join FacultyQualification on Tbl_Faculty.Faculty_Id=FacultyQualification.FacultyId
inner join Tbl_Course_Master on FacultyQualification.CourseId=Tbl_Course_Master.Course_Id
Inner Join Tbl_Specialisation_Master on Tbl_Specialisation_Master.Course_Id=FacultyQualification.CourseId
inner Join Designation_Master on Designation_Master.DesignationID=Tbl_Faculty.Designation_Id
  where Tbl_Faculty.College_Id='406' and Availabilty_Flag= 'N'
Posted
Updated 9-Sep-16 3:49am
v2
Comments
Maciej Los 9-Sep-16 8:50am
   
What is exact error message?
What database?

Note: we don't see your screen and we can't read in your mind!

closing bracket ")" is missing

where Tbl_Faculty.College_Id='406' and Availabilty_Flag= 'N' ) 
   
Comments
Member 12183079 9-Sep-16 6:35am
   
No Still Remain Error
Karthik_Mahalingam 9-Sep-16 6:38am
   
error message?
You're missing the closing parenthesis

SELECT distinct * FROM ( 
 select Tbl_Faculty.First_Name,Designation_Master.Designation_Description,Tbl_Course_Master.Course_Name,

 Tbl_Specialisation_Master.Specialisation_Name,FacultyQualification.PassingYr,
 Tbl_Faculty.Date_Of_Birth

 from Tbl_Faculty inner join FacultyQualification on Tbl_Faculty.Faculty_Id=FacultyQualification.FacultyId
 inner join Tbl_Course_Master on FacultyQualification.CourseId=Tbl_Course_Master.Course_Id
 Inner Join Tbl_Specialisation_Master on Tbl_Specialisation_Master.Course_Id=FacultyQualification.CourseId
 inner Join Designation_Master on Designation_Master.DesignationID=Tbl_Faculty.Designation_Id
 where Tbl_Faculty.College_Id='406' and Availabilty_Flag= 'N') 
   
Comments
Member 12183079 9-Sep-16 6:34am
   
No When i Close Then Error Still is Syntax Error In )
F-ES Sitecore 9-Sep-16 6:40am
   
Strip the comment right back to a basic query, then add your from and join clauses one by one until you get to the problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900