මට SQL හෙල්ප් එකක් දීපල්ලකෝ ?
මචන්ලා මට SQL හෙල්ප් එකක් දීපල්ලකෝ ?
මන් ගාව ටේබල් දේකක් තියෙනවා Join කරන්න ඕනේ.
Product table
product_id ||| Product_name
1 || aaaa
2 || bbbb
Product_Attributes
Product_id ||| Attribute_type ||| Attribute_value
1 || Brand || ABC
1 || Category || XYZ
1 || Type || PQR
2 || Brand || ABC
2 || Category || XYZ
2 || Type || LST
මට ඕනේ Attribute_type එක parameter එක විදිහට දීල product select කර ගන්න ඕනේ..
select * from product p,product_attributes pa
where
p.product_id=pa.product_id and
pa.Attribute_type='Brand' and
pa. Attribute_value='ABC' and
pa.Attribute_type='Category' and
pa. Attribute_value='XYZ' ;
ඔය විදිහට හැදුවට product pick වෙන්නේ නැ... දන්නා එකෙක් උදව් කරපියව් ..හදිස්සි 8+
මචන්ලා මට SQL හෙල්ප් එකක් දීපල්ලකෝ ?
මන් ගාව ටේබල් දේකක් තියෙනවා Join කරන්න ඕනේ.
Product table
product_id ||| Product_name
1 || aaaa
2 || bbbb
Product_Attributes
Product_id ||| Attribute_type ||| Attribute_value
1 || Brand || ABC
1 || Category || XYZ
1 || Type || PQR
2 || Brand || ABC
2 || Category || XYZ
2 || Type || LST
මට ඕනේ Attribute_type එක parameter එක විදිහට දීල product select කර ගන්න ඕනේ..
select * from product p,product_attributes pa
where
p.product_id=pa.product_id and
pa.Attribute_type='Brand' and
pa. Attribute_value='ABC' and
pa.Attribute_type='Category' and
pa. Attribute_value='XYZ' ;
ඔය විදිහට හැදුවට product pick වෙන්නේ නැ... දන්නා එකෙක් උදව් කරපියව් ..හදිස්සි 8+
Last edited:



