EOFException
结果:
SELECT item_id,
(CASE WHEN cat_level="1" THEN cat_name ELSE "" END) AS category,
(CASE WHEN cat_level="2" THEN cat_name ELSE "" END) AS sub_cat,
FROM item
当我添加| item id | category | sub_cat |
| 01 |transportation | |
| 01 | | car |
时,结果变为:
group by item_id
但如何显示以下内容?
| item id | category | sub_cat |
| 01 |transportation | |
答案 0 :(得分:0)
使用汇总功能,例如def checkValidTransactionRow(frame):
df['id'][(df['flag1']==1) & (df['flag2']==1) ].unique()
(并移除Max
中的ELSE ""
):
CASE