My SQL query is
SELECT distinct a.optionid,b.id,optionname
FROM Price a
Right JOIN Option_Type b
ON a.optionid = b.id
WHERE a.HId = 3
Price table stores the options for the HId 3 along with the price. In Option_Type table, I have options but no main HId field.
If I have added price for the options (suppose there are three options), it will add three records in Price table. But now if I add another option, a record will be added to Option_Type, it will have four records whereas Price still has three records and my above query returns three records. How do I get all the four records even if there is no price for a record?
Thanks
SELECT distinct a.optionid,b.id,optionname
FROM Price a
Right JOIN Option_Type b
ON a.optionid = b.id
WHERE a.HId = 3
Price table stores the options for the HId 3 along with the price. In Option_Type table, I have options but no main HId field.
If I have added price for the options (suppose there are three options), it will add three records in Price table. But now if I add another option, a record will be added to Option_Type, it will have four records whereas Price still has three records and my above query returns three records. How do I get all the four records even if there is no price for a record?
Thanks