sql server - Returning different tables based on parameter? -


for example, have function returns table columns follows:

returns table (a character varying, b boolean, c numeric)

then based on parameter result_mode default 'summary', want return different table follows:

returns table (a timestamptz, b boolean, c character varying, d numeric) 

originally have stored procedure in ms sql return results 'summary', 'customer item summary', 'item summary' etc. in postgresql, different think.

i might need create multiple functions if can't fit them 1 single function.

so, possible sort of have if-statement or case statement returns table based on parameter input?


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -