sql - postgresql run multiple select statements with different columns in single query -
i have 14 queries, such as
select activities.type, sum(activity_fees.amount) activity_fees inner join activities on activity_fees.activity_id = activities.id date(activities.due_at) = current_date - interval '1 day' group activities.type select avg(activities.rating) fellows inner join auth on a.a_id = f.id inner join activities on activities.fellow_id = fellows.id f.type in ('x', 'y', 'z') , auth.deactivated = false , date(activities.due_at) = current_date - interval '1 day' , activities.rating not null
i trying run queries @ once using gui. union , union can used when no of columns same in queries?
when using toad run sql queries if include delimiter such ;
i not sure how can done in postgresql?
thank you.
just pad columns don't have , union. instance:
select activities.type, sum(activity_fees.amount) ... union select 'dummy', avg(activities.rating) ....
or include activities.type since have available!
Comments
Post a Comment