Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
SQLStott
Starting Member
7 Posts |
Posted - 2011-07-27 : 23:51:42
|
| I need to create a view for two tables, these are just parts of the tables but here are the columns for each.mysql> SELECT * from quizzes;+---------+------------+-----------+----------+----------+-------------+------------+| QuizNum | QuizDate | HighScore | LowScore | AvgScore | NumStudents | NumPassing |+---------+------------+-----------+----------+----------+-------------+------------+| 1 | 2009-01-25 | 20.0 | 9.0 | 12.5 | 15 | 10 || 1 | 2009-06-15 | 30.0 | 22.0 | 25.6 | NULL | NULL || 1 | 2009-08-25 | NULL | NULL | NULL | 15 | 10 || 1 | 2010-01-24 | 20.0 | 9.0 | 12.5 | 17 | 14 || 1 | 2010-06-14 | 28.5 | 21.0 | 26.6 | 25 | 25 |2nd table+------------+---------+--------------------------------+----------------------+----------------------+----------------------+---------------------+------------------+------------+| QuestionId | TopicId | Text | AnswerA | AnswerB | AnswerC | AnswerD | CorrectstModDate | Difficulty |+------------+---------+--------------------------------+----------------------+----------------------+----------------------+---------------------+------------------+------------+| 1 | Wood | What is a lathe? | A handtool | A machine | A technique | Eye protection | BLL | 1 || 3 | Wood | Using turning you can make | A chair leg | A bowl | A decorative edge | Holes | ALL | 2 || 4 | Wood | Eye protection is | Never required | Needed if staining | Needed if sawing | Always required | C10-06-03 | 1 |Craig A Stott |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-07-28 : 00:20:17
|
1. SQLTeam is on Microsoft SQL Server. For MySQL, please post at forums.mysql.com2. a View is just like a query. CREATE VIEW <view name>ASSELECT t1.col1, t1.col1, . . . . t2.col3, t2.col4FROM Table1 t1 INNER JOIN Table2 t2 ON t1.somecol = t2.anothercol KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|