﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / select statement / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 14:05:40 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: select statement</title><link>http://www.sqlservercentral.com/Forums/Topic821823-146-1.aspx</link><description>slightly different than the correlated subquery is the option of using a CTE.  Use the cte to join back to the original table to get the results you are seeking.</description><pubDate>Thu, 19 Nov 2009 16:52:09 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: select statement</title><link>http://www.sqlservercentral.com/Forums/Topic821823-146-1.aspx</link><description>table structure is:Name, numbersOnly this.</description><pubDate>Thu, 19 Nov 2009 11:11:31 GMT</pubDate><dc:creator>river1</dc:creator></item><item><title>RE: select statement</title><link>http://www.sqlservercentral.com/Forums/Topic821823-146-1.aspx</link><description>This somewhat looks like homework, so I'll give you some hints here.I'd build an aggregate query that uses COUNT() to determine how many times each name appears. That it a very simple aggregate. Then make that a subquery and join it back to the original table on names, and join in the count from that subquery to get that value.</description><pubDate>Thu, 19 Nov 2009 11:10:47 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: select statement</title><link>http://www.sqlservercentral.com/Forums/Topic821823-146-1.aspx</link><description>Inline correlated subquery is one way.Without knowing your table structure, I can't really provide sample code for how to do it.</description><pubDate>Thu, 19 Nov 2009 11:09:47 GMT</pubDate><dc:creator>GSquared</dc:creator></item><item><title>select statement</title><link>http://www.sqlservercentral.com/Forums/Topic821823-146-1.aspx</link><description>Hi, I have a table named test. The table have this records:Name:     Numbers:pedro     	10        pedro     	11        paulo     	5         ana       	7         ana       	8ana        9         What i want is to make a select that will display a count for each equal name:Pedro 10  2pedro  11  2paulo   5   1Ana     7   3ana      8   3ana      9   3It will count the number of times that a name is equal.how can i make the select?Thank you.</description><pubDate>Thu, 19 Nov 2009 11:07:46 GMT</pubDate><dc:creator>river1</dc:creator></item></channel></rss>