Query Help

Results 1 to 2 of 2

Thread: Query Help

  1. #1
    Join Date
    Dec 1969

    Default Query Help

    I have data that has two fields - sections and order.<BR><BR>For example, the data could be represented as:<BR><BR>Section Order<BR>0A 1<BR>0A 2<BR>0A 3<BR>0A 4<BR>0A 5<BR>0A 6<BR>0B 1<BR>0B 2<BR>0B 3<BR>0B 4<BR>0B 5<BR>0B 6<BR>0C 1<BR>0C 2<BR>0C 3<BR>0C 4<BR>0C 5<BR>0D 1<BR>0D 2<BR>0D 3<BR>0D 4<BR>0D 5<BR><BR>I want a query that will yield the first item in a section such as:<BR>Section Order<BR>0A 1<BR>0B 1<BR>0C 1<BR>0D 1<BR><BR>and the second:<BR>0A 2<BR>0B 2<BR>0C 2<BR>0D 2<BR><BR>and so on all the way to the last one:<BR>0A 6<BR>0B 6<BR><BR>Any ideas how to do this?

  2. #2
    Join Date
    Dec 1969

    Default I think you just want...

    SELECT Section, Order from TableName Order by Order, Section<BR><BR>btw<BR>Both &#039;Section&#039; and &#039;Order&#039; could be reserved words in your database so it may be necessary to put brackets around them<BR><BR>SELECT [Section], [Order] from TableName Order by [Order], [Section]

Posting Permissions

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