Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can I order the result according to inlist type data
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00968680
Message ID:
00968698
Views:
8
Try
lcList = "16, 10, 12, 15, 8, 1"
CREATE CURSOR crsList (customer_id int, sortord int)

FOR i=1 TO ALINES(laList, lcList, ",")
	INSERT INTO crsList VALUES(VAL(laList[i]), i)
ENDFOR

select cs.customer_id   ;
	from Customer cs ;
		JOIN crsList ls ON ls.customer_id = cs.customer_id ;
	ORDER BY ls.sortord ;	
	into cursor curCustormer
>
>select customer_id  ;
>  from Customer ;
> where customer_id in (16, 10, 12, 15, 8, 1) ;
>  into cursor curCustormer
>
>
>How can I order the result cursor according to data in the set of inlist expressions
>
>
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform