SQLTeam.com | Weblogs | Forums

Return to first record

sql2008

#1

Hi I have 2 tables and I want to join them both are
Table Lesson
ID Lesson
M001 Math
M002 English
M003 Bahasa
M004 France
M005 German

Table Schedule
Date ID
01-01-2017 M001
06-01-2017 M002
12-01-2017 M003
22-01-2017 M004
28-01-2017 M005

I wan to make the result like this

Table Schedule
Date ID Lesson
01-01-2017 M001 Math
06-01-2017 M002 English
12-01-2017 M003 Bahasa
22-01-2017 M004 France
28-01-2017 M005 German
04-02-2017 M001 Math
10-02-2017 M002 English
16-02-2017 M003 Bahasa
22-02-2017 M004 France
26-02-2017 M005 German
02-03-2017 M001 Math
and so on..
the lesson record returning to the first record..

thx


#2

This looks like homework, so I'll only give you a hint. Read up on INNER JOIN


#3

sorry could you tell me more detail?

thx