Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting order in the select statement: 2

Status
Not open for further replies.

hunterspot

Programmer
Jun 3, 2009
22
US
Hi all

Generally I set order before a select statement like this:
select company
set order to comp_id in company
select * from company where comp_id = [XXXXXXXXX]

Is there a way combining these 2 lines into one in the select statement?

If not can we set order for foxpro tables from asp.net?

Thanks for your time and help
 
select * from company ;
where comp_id = [XXXXXXXXX] ;
order by comp_id
 
Hunterspot,

select company
set order to comp_id in company
select * from company where comp_id = [XXXXXXXXX]

The first two lines are redundant. When you do a SQL SELECT, it ignores the selected work area and order.

If you want the result set to be in a specific order, do as Imaginecorp suggested.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top