Results 1 to 13 of 13

Thread: How to do Order By in Sub Query

Threaded View

  1. #1

    Thread Starter
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    How to do Order By in Sub Query

    Hi,
    Can any one please help me with sorting with sub query, i have a query something like the following.

    Select a, b, c, (Select Count(b) From MyTable Where c=a as MyCount) From TableName

    Now as you can see i have a count field called MyCount which is the result of a subquery, the thing i want to know is how would i use order by stement on that count field.

    I tried [Select a, b, c, (Select Count(b) From MyTable Where c=a as MyCount) From TableName Order By MyCount] but it doesnt work.

    Any ideas would be appriciated.

    Thanks

    Danial
    Last edited by Danial; Mar 29th, 2002 at 01:42 PM.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width