| Author: ANIL PANDEY 05 Sep 2008 | Member Level: Diamond | Rating: Points: 2 |
hi,
u can use like this,
select top 1 count(*) as c from ##temp
hope this will work for u...
regards Anil
|
| Author: Neethul Raveendran 05 Sep 2008 | Member Level: Silver | Rating: Points: 2 |
thats k... but i need to apply where subquery will be returning values only because in my project the subquery count will return more than one values which i need to use based on the conditions Please put ur thoughts to this.
Thanks in advance.
|
| Author: Geetha 05 Sep 2008 | Member Level: Gold | Rating: Points: 1 |
hi i tried a query like that. but it is not possible it seems. better u split it into two queries and try. First get the count. and then use it with the top.
Geetha.
|
| Author: Neethul Raveendran 05 Sep 2008 | Member Level: Silver | Rating: Points: 1 |
thats fine... hope ur telling the alternative solutions. If yes please can u demostrate with an example
Thanks in advance.
|
| Author: Barani 05 Sep 2008 | Member Level: Silver | Rating: Points: 1 |
can u give me somemore details regarding wht u need so that i can help u.. i am sure there will be a solution for it... revert me soon
|
| Author: Lakhan Pal 05 Sep 2008 | Member Level: Gold | Rating: Points: 2 |
First Get the Count in A Variable in a Seprate Query Like Declare @Count int DECLARE @SQLQuery select @Count=count(*) from ##temp SET @SQLQuery='select top'+ Convert(Varchar(10),@Count)+' * from <Table Name>' EXEC (@SQLQuery)
Hope This will Work.
|
| Author: Neethul Raveendran 05 Sep 2008 | Member Level: Silver | Rating: Points: 1 |
Thanks yaaar.... i am very glad.... Thanks Once again to all...
|
| Author: Suba Ganesh 06 Sep 2008 | Member Level: Silver | Rating: Points: 2 |
hi,
u can use like this,
select top 1 count(*) as c from ##temp
hope this will work for u...
|