Hi, I need some advice please. I need to join two tables together. Here is my Table A. I have this Table B and here is the result i expected You will see on the result table i want to maintain the exact number of rows from Table A and if rating is not available for certain person from Table B, it will just be NULL. Thank you in advance.
that doesn't have a group statement or a way to default rateperiod to 1. This will work better select users.eid , users.name , rating.rating , case when rating.rateperiod is null then 1 else rating.rateperiod end as rp from users left join rating on users.eid = rating.eid group by users.eid; Code (SQL): For a working example check out http://sqlfiddle.com/#!9/48f277/9