开发者

recordset advance query

开发者 https://www.devze.com 2022-12-28 05:34 出处:网络
I\'d like to have a query for the first and last name on an enrollment list so that only one result show. Howeve开发者_如何学运维r, if only the last name is chosen in the query multiple answers will s

I'd like to have a query for the first and last name on an enrollment list so that only one result show. Howeve开发者_如何学运维r, if only the last name is chosen in the query multiple answers will show.


You can GROUP BY the last name field in your query.

For example if you had this data:

MyTable:
id last_name first_name
1  Smith     John
2  Smith     Jane
3  Jones     Paul

Running a query like this:

SELECT t.last_name 
  FROM MyTable t
GROUP BY t.last_name
ORDER BY t.last_name

...would return these two rows:

Jones
Smith
0

精彩评论

暂无评论...
验证码 换一张
取 消