how do i convert fields to other fields in a google big query?

SELECT user_id,
       SUM(CASE WHEN status='credit' THEN amount ELSE 0 END) credit,
       SUM(CASE WHEN status='deposit' THEN amount ELSE 0 END) deposit 
FROM src_table
GROUP BY user_id

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top