有關排名(名次)
Create Cursor T1 (學號 I,姓名 C(10),分數 N(10,2))
Insert Into T1 Values (1,"學生1",900)
Insert Into T1 Values (2,"學生2",360)
Insert Into T1 Values (3,"學生3",800)
Insert Into T1 Values (4,"學生4",630)
Insert Into T1 Values (5,"學生5",240)
Insert Into T1 Values (6,"學生6",90)
Insert Into T1 Values (7,"學生7",240)
Insert Into T1 Values (8,"學生8",900)
Insert Into T1 Values (9,"學生9",480)
Insert Into T1 Values (10,"學生10",108)
Browse
*--VFP9.0(子查詢)
Select A.*,(Select Count(*) From T1 B Where A.分數<=B.分數) As 名次 From T1 A Order By 名次
請問這個A.* 的A表是從哪來的,看不懂,但實際操作是成功的
uj5u.com熱心網友回復:
有沒有推薦一些整理好的vfp 命令技巧的文章給我學習一下,網上都是零散的,需要慢慢找uj5u.com熱心網友回復:
Select ...... From T1 A ......uj5u.com熱心網友回復:
就是這個,術語是表的別名
uj5u.com熱心網友回復:
T1 A ---> T1 as Auj5u.com熱心網友回復:
Select A.*,(Select Count(*) From T1 B Where A.分數<=B.分數) As 名次 From T1 A Order By 名次,這個話我看懂了,分別給t1兩個別名,內嵌的為t1 b; 外圍的from t1 a;屬于自己給自己查uj5u.com熱心網友回復:
這個查詢的問題是并列的名次完全錯誤uj5u.com熱心網友回復:
并列 的都按低名次算的。也不算錯!轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/52751.html
標籤:VFP
上一篇:vfp資料庫
