【发布时间】:2015-04-23 03:13:54
【问题描述】:
我有以下 2 个表
表 1 - 问题
包含为每个问题分配的问题和标记
ID| Questions | Marks
________________________________________
1 | What is your name? | 2
2 | How old are you? | 2
3 | Where are you from? | 2
4 | What is your father's name? | 2
5 | Explain about your project? | 5
6 | How was the training session?| 5
表 2 - 问题格式
包含要为一组分数提取多少个问题(计数)
Mark | Count
-------------
2 | 2
5 | 1
我希望根据表 [Question_Format] 中设置的 [count] 从表 [Questions] 中提取随机问题。
ID | Question
----------------------------
2 | How old are you?
3 | Where are you from?
6 | How was the training session?
【问题讨论】:
标签: sql sql-server sql-server-2008 select stored-procedures