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
JAYRAM
NA
272
215.4k
.plz write storedprocedure quarie display only distinct name
Mar 19 2013 2:07 AM
below my stored procedure display all duplicate values ......plz write storedprocedure quarie display only distinct names..
storedprocedure....
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
ALTER Proc [dbo].[Register_List]
(
@flag int=null,
@srch varchar(max)=null
)
as
begin
if(@flag=1)
begin
select R.SNO,
R.IdNo,
R.SurName,
R.MiddleName,
R.LastName,
R.FatherName,
CONVERT(nvarchar,R.DOB,106)as DOBs,
R.Sex,
R.DNO,
R.Street,
R.Colony,
R.Location,
Mc.MasterName as City,
Md.MasterName as District,
R.Pin,
R.LandLine,
R.Mobile,
R.Email,
R.Qualification,
R.Occupation,
R.Voter,
R.Locality,
R.StationNo,
R.VoterIdNo,
R.VoterSerailNo,
R.ReferMemberId,
R.ReferSurName,
R.ReferMiddleName,
R.ReferLastName,
M.MasterName as Category ,
M.MasterName as ReferType,
R.Localityinterest,
CONVERT(nvarchar,R.CreatedOn,106)as crt,
CONVERT(nvarchar,R.Marriage_Date,106)as Marriage_Date,
R.Division
from Registration R
left join tblMaster M on(R.Category=M.MasterId)
left join tblMaster Mc on(R.City=Mc.MasterId)
left join tblMaster Md on(R.District=Md.MasterId)
where MiddleName like + '%' + @srch +'%'
end
Reply
Answers (
1
)
Stored Procedure for calculating total no of leaves
storedprocedure quarie....display only distinct name and mo