SQLTeam.com | Weblogs | Forums

Correction?

sql2008

#1

Below code gives no results

select customtimestamp.info, wo.num from customtimestamp
join costlayer on costlayer.recordid = customtimestamp.recordid
join part on part.id = costlayer.partid
join moitem on moitem.partid = part.id
join woitem on woitem.moitemid = moitem.id
join wo on wo.id = woitem.woid
group by customtimestamp.info, wo.num


#2

What is your question?


#3

it means there isn't any record from those table that matches your JOIN condition. I have re-formatted your query, make this is easier to verify the JOIN statement

SELECT customtimestamp.info,
	wo.num
FROM customtimestamp
INNER JOIN costlayer
	ON costlayer.recordid = customtimestamp.recordid
INNER JOIN part
	ON part.id = costlayer.partid
INNER JOIN moitem
	ON moitem.partid = part.id
INNER JOIN woitem
	ON woitem.moitemid = moitem.id
INNER JOIN wo
	ON wo.id = woitem.woid
GROUP BY customtimestamp.info,
	wo.num