SQL Statment Help |
|
is_tem
一般會員 發表:17 回覆:15 積分:11 註冊:2002-04-17 發送簡訊給我 |
Suppose you have a Table Like that
Name, Clock in Time
Staff A 09:00
Staff B 10:00
Staff A 09:25
Staff B 11:34
Staff B 12:36 What will be the SQL statement to retrieve the first and the last transaction of the staff, such as the result will be;
Staff A 09:00 09:25
Staff B 10:00 12:36
|
ccchen
版主 發表:61 回覆:940 積分:1394 註冊:2002-04-15 發送簡訊給我 |
引言: Suppose you have a Table Like that Name, Clock in Time Staff A 09:00 Staff B 10:00 Staff A 09:25 Staff B 11:34 Staff B 12:36 What will be the SQL statement to retrieve the first and the last transaction of the staff, such as the result will be; Staff A 09:00 09:25 Staff B 10:00 12:36select NAME,min("Clock in Time"),max("Clock in Time") from Tablename group by NAME |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |