[thelist] Query Logic

Casey Crookston caseyb at thecrookstons.com
Tue Feb 19 22:29:31 CST 2008


Hi,

I need a little help building a query.  The DB is MS SQL 2000.  I have an 
existing query which, to make things simple, looks like this:

SELECT * FROM myTable

And returns something line this:

ID     Store        Description
1       StoreA     description1
2       StoreA     descriotion2
3       StoreA     description3
4       StoreB     description4
5       StoreB     descriotion5

What I need, however, is only the first row per each new store.  Or....

ID     Store        Description
1       StoreA     description1
4       StoreB     description4

How would I orgainze select statements and any sub queries to accomplish 
this?  Thanks!

Casey 




More information about the thelist mailing list