7. Pivot, Window function (Rank & sum), Date
Pivot Pivot is commonly used in Excel, and I've learned that it can also be applied in SQL. Through the following example, I was able to create the result values in a pivot table format. select restaurant_name, max(if(hh='15', cnt_order, 0)) "15", max(if(hh='16', cnt_order, 0)) "16", max(if(hh='17', cnt_order, 0)) "17", max(if(hh='18', cnt_order, 0)) "18", max(if(hh='19', cnt_order, 0)) "19", ma..
2024. 3. 22.