Re: How to join table to itself N times?
От | David Johnston |
---|---|
Тема | Re: How to join table to itself N times? |
Дата | |
Msg-id | 1363831789057-5749125.post@n5.nabble.com обсуждение исходный текст |
Ответ на | How to join table to itself N times? ("W. Matthew Wilson" <matt@tplus1.com>) |
Список | pgsql-general |
Matt Wilson wrote > I got this table right now: > > select * from market_segment_dimension_values ; > +--------------------------+---------------+ > | market_segment_dimension | value | > +--------------------------+---------------+ > | geography | north | > | geography | south | > | industry type | retail | > | industry type | manufacturing | > | industry type | wholesale | > +--------------------------+---------------+ > (5 rows) Most likely you can solve your problem by using the "hstore" extension. I could be more certain of this if you actually state the requirements/use-case/business-problem. SQL requires that you know the column structure of the output so if hstore does not suffice you will have to execute a dynamic query in your API after querying the dimension map table to decide how many output columns you will need. hstore avoids that by giving you a dynamic table-in-a-column. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/How-to-join-table-to-itself-N-times-tp5749107p5749125.html Sent from the PostgreSQL - general mailing list archive at Nabble.com.
В списке pgsql-general по дате отправления: