怎樣尋找欄位中某一特定資料 (SQL statment) |
答題得分者是:BOSS
|
lafite
一般會員 發表:4 回覆:7 積分:2 註冊:2003-08-29 發送簡訊給我 |
資料庫 : student
學號 成績 3A001 90 3A002 80 3A003 75 3A004 60 3A101 100 3A102 85 3A103 100 3A104 92 3B001 64 3B002 83 3B003 76 3B004 49 3B101 77 3B102 81 3B103 93 3B104 68 | | | | | |_座號 | |___上午/下午班 |_____班別 Student.Active := False; Student.SQL.Clear; Student.SQL.Add('SELECT 學號, 成績 FROM Student'); Student.SQL.Add('where ( copy(學號,1,2) =' '''3A''' ')'); Student.SQL.Add('order by 學號'); Error Msg 'Copy is not a recognized function name' 請問怎樣可以在 SQL Statment 中 找出某一班的成績 |
BOSS
中階會員 發表:70 回覆:79 積分:64 註冊:2006-11-01 發送簡訊給我 |
===================引 用 文 章=================== 資料庫 : student 學號????????? 成績 3A001????? 90 3A002????? 80 3A003????? 75 3A004???? ?60 3A101???? 100 3A102???? 85 3A103???? 100 3A104???? 92 3B001???? 64 3B002?? ? 83 3B003???? 76 3B004? ?? 49 3B101???? 77 3B102???? 81 3B103???? 93 3B104???? 68 |??? |? | |??? | ?|_座號 |?? ?|___上午/下午班 |_____班別 Student.Active := False; Student.SQL.Clear; Student.SQL.Add('SELECT 學號, 成績 FROM Student'); Student.SQL.Add('where ( copy(學號,1,2) =' '''3A''' ')'); Student.SQL.Add('order by 學號'); Error Msg 'Copy is not a recognized function name' 請問怎樣可以在 SQL Statment 中 找出某一班的成績 select * from student where substring(num_,1,2)='3A' or select * from student where left(num_,2)='3A' |
BOSS
中階會員 發表:70 回覆:79 積分:64 註冊:2006-11-01 發送簡訊給我 |
===================引 用 文 章=================== 資料庫 : student 學號????????? 成績 3A001????? 90 3A002????? 80 3A003????? 75 3A004???? ?60 3A101???? 100 3A102???? 85 3A103???? 100 3A104???? 92 3B001???? 64 3B002?? ? 83 3B003???? 76 3B004? ?? 49 3B101???? 77 3B102???? 81 3B103???? 93 3B104???? 68 |??? |? | |??? | ?|_座號 |?? ?|___上午/下午班 |_____班別 Student.Active := False; Student.SQL.Clear; Student.SQL.Add('SELECT 學號, 成績 FROM Student'); Student.SQL.Add('where ( copy(學號,1,2) =' '''3A''' ')'); Student.SQL.Add('order by 學號'); Error Msg 'Copy is not a recognized function name' 請問怎樣可以在 SQL Statment 中 找出某一班的成績 select * from student where substring(num_,1,2)='3A' or select * from student where left(num_,2)='3A' |
lafite
一般會員 發表:4 回覆:7 積分:2 註冊:2003-08-29 發送簡訊給我 |
|
whyzn
中階會員 發表:46 回覆:149 積分:54 註冊:2002-06-16 發送簡訊給我 |
請問 BOSS 兄
我的環境是 XP Delphi5 但是 Query 元件 的 Sql 語法中不能用 Left , SubString 這些函數 不知哪裡需要調整 請指教 ===================引 用 文 章=================== ===================引 用 文 章=================== 資料庫 : student 學號????????? 成績 3A001????? 90 3A002????? 80 3A003????? 75 3A004???? ?60 3A101???? 100 3A102???? 85 3A103???? 100 3A104???? 92 3B001???? 64 3B002?? ? 83 3B003???? 76 3B004? ?? 49 3B101???? 77 3B102???? 81 3B103???? 93 3B104???? 68 |??? |? | |??? | ?|_座號 |?? ?|___上午/下午班 |_____班別 Student.Active := False; Student.SQL.Clear; Student.SQL.Add('SELECT 學號, 成績 FROM Student'); Student.SQL.Add('where ( copy(學號,1,2) =' '''3A''' ')'); Student.SQL.Add('order by 學號'); Error Msg 'Copy is not a recognized function name' 請問怎樣可以在 SQL Statment 中 找出某一班的成績 ? select * from student where substring(num_,1,2)='3A' or select * from student where left(num_,2)='3A'
------
●○○○○○●○○○○○● 竹密不妨水過,山高無礙雲飛 |
pcboy
版主 發表:177 回覆:1838 積分:1463 註冊:2004-01-13 發送簡訊給我 |
|
whyzn
中階會員 發表:46 回覆:149 積分:54 註冊:2002-06-16 發送簡訊給我 |
|
japhen
中階會員 發表:2 回覆:57 積分:71 註冊:2006-08-16 發送簡訊給我 |
|
whyzn
中階會員 發表:46 回覆:149 積分:54 註冊:2002-06-16 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |