Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 I need sql small Query

Author  Topic 

Easwar
Yak Posting Veteran

59 Posts

Posted - 2007-03-10 : 03:11:52
in my table have two column one post(varchar) and another one views(decimal).in table have no.of data's.......
sample data's

Ex i want this Result
post views post views

std 400 std 400
abc 100 abc 100
dbn 10 sdfe 75
sdfe 75 dbn 10
.... .....
..... ....
....


i need one query....... condition view best top 10 post based on views column

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-03-10 : 03:40:22
select the top 10 views then do the formating you required in your front end app

select top 10 post, views
from yourtable
order by views desc



KH

Go to Top of Page

Easwar
Yak Posting Veteran

59 Posts

Posted - 2007-03-10 : 04:15:23
Thanks sir

That query worked
Go to Top of Page
   

- Advertisement -