List:General Discussion« Previous MessageNext Message »
From:zzapper Date:April 15 2004 11:43am
Subject:Re: Complicated Inner Joins
View as plain text  
Here's another rotter!

I searched UseNet and read that in MySQL you cannot have a sub-select,
but I'm lost as to how to split this into two selects?

SELECT distinct p.ProjectID ,p.ProjectName FROM tbl_project AS p
      (tbl_UnitType AS ut INNER JOIN tbl_RateType AS r ON ut.RateType
= r.RateType) 
            INNER JOIN (tbl_SubProject AS sp 
                  INNER JOIN (Select * FROM tbl_ProjectResource 
            WHERE UserID = '#rptUserID#' 
            AND Deleted = 0
                AND ((ActivityDate) Between #datDateFrom# And
                  ) AS pr ON sp.SubProjectID = pr.SubProjectID)
            ON ut.Unit = pr.Unit
   ) INNER JOIN tbl_RateTypeCategoryCharge AS rt ON
pr.RateTypeCategoryChargeID = rt.RateTypeCategoryChargeID

) ON p.ProjectID = sp.ProjectID
WHERE ut.reportDisplay = 1            

zzapper (vim, cygwin, wiki & zsh)

vim -c ":%s/^/WhfgTNabgureRIvzSUnpxre/|:%s/[R-T]/ /Ig|:normal ggVGg?"  Best of Vim Tips

Complicated Inner Joinszzapper14 Apr
  • Re: Complicated Inner JoinsBrent Baisley14 Apr
  • Re: Complicated Inner Joinszzapper15 Apr
  • Re: Complicated Inner Joinszzapper15 Apr
    • Re: Complicated Inner JoinsPaul DuBois17 Apr