Hi,
I want this result:
ProductName FirstName SecondName
Server Jesse James
PC Peter Parker
Laptop null null
My problem is that ProductName comes from a different table, First Name and Last Name from user table and there is an association between the two in another table
I have tried writing joins for this but am struggling right now. This was my earlier query when Firstyname and second name could not be null
select product.productname, userprofile.firstname, userprofile.secondnamefrom userprofile, product, facilityuserassoc where facilityuserassoc.fk_product_user_type_id = 1 and facilityuserassoc.fk_product_id = product.pk_product_id and facilityuserassoc.fk_user_id = userprofile.pk_user_id
Can you please have a look into this.




Reply With Quote