Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #861

Table with a variable number of elements in a column

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From Bill Gunshannon <bill.gunshannon@gmail.com>
Newsgroups comp.databases.postgresql
Subject Table with a variable number of elements in a column
Date Sat, 27 Apr 2019 14:59:11 -0400
Lines 26
Message-ID <gijn3vF68nnU1@mid.individual.net> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace individual.net YOqrkixa3X4RrWImsmhNbQ7bp20v05XNcv1x5S2QVE3klYHABW
Cancel-Lock sha1:ZOPDhRF/33uU9INKfUG1Qq9Zi8s=
X-Mozilla-News-Host news://news.individual.net:119
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1
Content-Language en-US
Xref csiph.com comp.databases.postgresql:861

Show key headers only | View raw



Not sure what the right terminology for this is, but I will
provide my example and see if anyone can tell me how I might
do this.

I want to create a database table for an index of all my record
albums.

The basic stuff is easy.

Title, Artist, Publisher and the Publisher's ID # as a primary
unique key.
But then I get to the hard part.
Number of tracks and then a list of those tracks.
This would, obviously, be different and variable from album to album.

So, I need a way to define a table that has a variable number of fields
depending on the value in Number-of-Tracks.

Is there any way in standard SQL to do this without just having a
large number of fields and only using the number you need?


bill

Back to comp.databases.postgresql | Previous | NextNext in thread | Find similar


Thread

Table with a variable number of elements in a column Bill Gunshannon <bill.gunshannon@gmail.com> - 2019-04-27 14:59 -0400
  Re: Table with a variable number of elements in a column John-Paul Stewart <jpstewart@sympatico.ca> - 2019-04-27 15:39 -0400
    Re: Table with a variable number of elements in a column Bill Gunshannon <bill.gunshannon@gmail.com> - 2019-04-27 15:48 -0400
      Re: Table with a variable number of elements in a column John-Paul Stewart <jpstewart@sympatico.ca> - 2019-04-27 16:02 -0400
        Re: Table with a variable number of elements in a column Bill Gunshannon <bill.gunshannon@gmail.com> - 2019-04-27 16:29 -0400
          Re: Table with a variable number of elements in a column John-Paul Stewart <jpstewart@sympatico.ca> - 2019-04-27 17:10 -0400
            Re: Table with a variable number of elements in a column Bill Gunshannon <bill.gunshannon@gmail.com> - 2019-04-27 18:40 -0400
              Re: Table with a variable number of elements in a column John-Paul Stewart <jpstewart@sympatico.ca> - 2019-04-27 19:26 -0400
  Re: Table with a variable number of elements in a column alexander.d.mills@gmail.com - 2020-02-21 14:02 -0800
    Re: Table with a variable number of elements in a column Christian Barthel <bch@online.de> - 2020-02-22 09:15 +0100

csiph-web