How to use if and onlf if in a select statement in sql server 2005?
Here is my select statement select Mat_Id,MeasurementId from InTime…
Now i want to show measurementName which is Measurment Table based on MeasurementId..
Mind you MeasurementId is not a foriegn key…
How to make join with Measurement table if there is value in MeasurementId field of InTime Table
alt text http://www.freeimagehosting.net/uploads/e42f0234d8.jpg
Use a left join:
If you only want the rows that have measurement names, use an INNER JOIN instead of a LEFT JOIN.
Also, you have a typo: Measurment should be Measurement. I’m not sure if that’s a problem with your database or your question.