|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, April 15, 2013 6:28 AM
Points: 14,
Visits: 176
|
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 6:53 AM
Points: 19,
Visits: 144
|
|
edit: this should be one of the most basic queries ever. so, i have been surprised why you have choosen to add an identity column and querying the table twice with joins, etc.
shouldn't the script below suit your needs?
select y,x from t1 (NOLOCK) group by y, x having count(1) > 1
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Friday, April 09, 2010 5:28 AM
Points: 7,
Visits: 15
|
|
Infact, I didin't understand why you wrote like that code. Where is the difference from below code.
I think It's very easy.
SELECT * FROM t1 WHERE y IN ( SELECT y FROM t1 GROUP BY y HAVING COUNT(y)>1 )
Thanks.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, December 27, 2012 4:15 AM
Points: 152,
Visits: 84
|
|
this has gotta be the most pathetic script i've ever seen...
I'm surprised SSC even published this!!
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Monday, February 18, 2013 1:11 AM
Points: 478,
Visits: 128
|
|
WHY???
you can use the following SELECT x, y, COUNT(y) AS How_Many_Times FROM t1 GROUP BY x, y HAVING (COUNT(y) > 1)
I don't understand 1.why do you have to add a rowid!! 2.what is the purpose of adding a third column (z) with a default value of zero!!!
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, March 05, 2013 11:47 AM
Points: 13,
Visits: 47
|
|
ABHILASH DHONGDI (6/18/2008) this has gotta be the most pathetic script i've ever seen...
I'm surprised SSC even published this!!
My thoughts, exactly. You can pick any line in the article and find problems with it. Awful.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Friday, May 10, 2013 4:36 PM
Points: 19,
Visits: 83
|
|
I would have to agree with the other posts... this script stinks on ice.
How does this warrant a hyperlink to the "solution script".
Lets keep the quality of the site high.... Fortunately, it usually is

|
|
|
|