我有这张桌子
UMS
id_attribute value order
1 MB 1
1 Gb 2
1 TB 3
...
还有这张桌子
ATTRIBUTE_VALUE
id id_attribute value name ums
1 1 50 hdd GB
2 1 100 hdd TB
3 2 15.00 price NULL
我想从 id_attribute=1 的 ATTRIBUTE_VALUE 中选择,如果存在(UMS.value=ATTRIBUTE_VALUE.ums),然后按 UMS.order 排序,如果按 ATTRIBUTE_VALUE.value 分组
输出示例:
50 GB
100 Tb
and must to appear
15.00 !!! here is the problem because in my UMS table i don't have UMS for price
but it doesn't appear