mercredi 14 janvier 2015

Allowing additional data to be added after a join with blank rows

I've got a left join query that returns the correct number of rows (equal to the left table), but because the right table is empty, there are no corresponding rowid's. How can I add the rowid (RecNum should be the same value) to the empty table so that I can add data to the resulting dataset? Here's the query:



select
Week01.RowID as RowID,
Week01.WRecNum as WRecNum,
Week01.RecNum as RecNum,
Week01.UserName as UserName,
Week01.Day1Reg as Day1Reg,
Week01.Day1OT as Day1OT,
Week01.Day2Reg as Day2Reg,
Week01.Day2OT as Day2OT,
Week01.Day3Reg as Day3Reg,
Week01.Day3OT as Day3OT,
Week01.Day4Reg as Day4Reg,
Week01.Day4OT as Day4OT,
Week01.Day5Reg as Day5Reg,
Week01.Day5OT as Day5OT,
Week01.Day6Reg as Day6Reg,
Week01.Day6OT as Day6OT,
Week01.Day7Reg as Day7Reg,
Week01.Day7OT as Day7OT
from
"Project List"
left join
Week01
on
"Project List".RecNum = Week01.RecNum
and
Week01.UserName = "JustMe"

Aucun commentaire:

Enregistrer un commentaire