Skip to content

SQL pivot query to get the result in a single row

I have a users table as I have another user_custom_fields table as and a third custom_fields table Here the problem is I need the result for each user in a single row with all the custom field_name as column header as I have heard about pivot queries but I don’t have much knowledge of SQL. Can anyone he…

How to group dates in Quarters in SQLite

I need to group my dates as Quarters, April to June as Q1, Jul to Sep as Q2, Oct to Dec as Q3 and Jan to March as Q4 I need to add another column besides close_dates showing Quarters. I cannot find …