Return multiple columns and rows from a function PostgreSQL instead of record

后端 未结 3 730
滥情空心
滥情空心 2021-01-19 07:52

I was reading online about function on PostgreSQL and returns results In this links:

  1. SQL function return-type: TABLE vs SETOF records
  2. How do I referen
相关标签:
3条回答
  • 2021-01-19 08:02

    I was able to see it as expected with this query:

    SELECT * FROM brand_hierarchy (id)
    
    0 讨论(0)
  • 2021-01-19 08:12

    Functions returning a table (or setof) should be used in the FROM clause:

    select * 
    from brand_hierarchy(1234)
    
    0 讨论(0)
  • 2021-01-19 08:18

    I found this function crosstab I think it is what you're looking for https://www.postgresql.org/docs/9.3/tablefunc.html

    0 讨论(0)
提交回复
热议问题