我在这些领域子查询在Access
Student:
ID(PK) Name Family Tel
Lesson:
ID StudentRef(FK(Student)) Name Score
访问2个表假设我们有这些记录
Student :
1 Tom Allen 09370045230
2 Jim leman 09378031380
Lesson:
1 1 Math 18
2 1 Geography 20
3 2 Economic 15
4 2 Math 12
我怎么能写结果会是这样(2场)查询?
Tom Math : 18 , Geography 20
Jim Economic :15 , Math :12
这可能有所帮助:http://stackoverflow.com/questions/8601643/access-sql-query-to-concatenate-rows/8603245#8603245 – Fionnuala 2011-12-25 20:14:31
适当[示例代码](http://sscce.org/) (这里是SQL语句)比任何ad hoc模式和样本数据格式更有用。请使用'CREATE TABLE'和'INSERT ... VALUES'作为样本。所需的结果不需要作为示例代码呈现,因为结果是代码的输出,而不是代码本身。 – outis 2012-03-26 00:41:58