TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mohit Kala
566
2.1k
136k
Need Help In Sql Filter Query
Jun 18 2018 1:05 AM
I Have 3 Dropdwon Branch,department,level And i Want to filter record according to these 3 parameters all parameters is nullable
my query is
SELECT e.EmployeeID,e.LevelID,e.EmployeeCode,e.EmailID,e.MobileNo,e.BranchID,e.DepartmentID,e.EmployeeName,
b.BranchName,d.DepartmentName FROM EMPLOYEE e
LEFT OUTER JOIN Department d ON d.DepartmentID=e.DepartmentID
LEFT OUTER JOIN Branch b ON b.BranchID=e.BranchID
WHERE e.IsDeleted<>1 AND @BranchID IS Null or e.BranchID=@BranchID AND @DepartmentID IS NULL OR
e.DepartmentID=@DepartmentID AND @LevelID IS NULL OR e.LevelID=@LevelID
Pls Help Me
Reply
Answers (
4
)
copy table data to excel through stored procedure.
Group by with out aggregate function