October 10, 2007 at 6:49 am
i have a table.
fields =
1) Id
2) name
3) EmailId
4) Age
5) Salary
now i want distinct recordsbased on name and EmailId then what should do me
October 10, 2007 at 6:54 am
select DISTINCT name, emailID from table
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
October 10, 2007 at 7:00 am
this is right but i want to find out all fields whereas it gives only two field.
October 10, 2007 at 7:12 am
You may want to create a temp table and dump the data into that table and delete the duplicate rows using a cursor and fetch the data and display it to the end user.
Because if you want to include all the columns you need to include them in group by or distinct and that would not yeild you what you are desiring to. Cursors are not recommended because of performance issues.
Prasad Bhogadi
www.inforaise.com
October 10, 2007 at 7:13 am
Give some example of what your data looks like, and on that data, how you wish to apply the 'distinct'..
That is, indata, and expected output from that data.
/Kenneth
October 10, 2007 at 7:41 am
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy