March 27, 2012 at 2:31 pm
hi,
i have one group suppose @member ,that is parent group,now they has member ,member1 and another child group @member_m,now this child group also has member member1,
when i select from @member it display 2 times member1,how to get it once only.
thanks
March 27, 2012 at 2:44 pm
DISTINCT???
If you want real answer you need to give us some information to work with. See the first link in my signature.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
March 27, 2012 at 2:57 pm
thanks solve it with distinct
March 27, 2012 at 2:59 pm
Just a reminder that using DISTINCT often times is masking a bigger issue. Perhaps if you provided sample data and sample tables with your sample query, a better solution can be provided.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
March 27, 2012 at 4:16 pm
SQLRNNR (3/27/2012)
Just a reminder that using DISTINCT often times is masking a bigger issue. Perhaps if you provided sample data and sample tables with your sample query, a better solution can be provided.
Ya beat me to it on this one 😀 but I have to emphasize how import this is. I definitely agree. With exceptions, of course, a lot of people use DISTINCT to overcome a bad join which creates a many-to-many join which can cripple a server behind the scenes.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply