Creating a limits table

Поиск
Список
Период
Сортировка
От Kurt R Marquardt
Тема Creating a limits table
Дата
Msg-id CABtkwHW994WY+c=ZBKu7_S9TKBJ_ANpvyoVMhgvDjZd761DxdQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Creating a limits table  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-novice
I have  a DB with 200+ categories and 3500+ products.  There are two columns in the product category 'model' and 'top_model'.  The 'model' is the SKU (top_model with attributes).  An example would be a tee shirt 'top-model' AB101; 'model' AB101-sm-blue.  So if it came in 4 different sizes and 4 different colors there would be 16 'models' with 1 'top_model'.  I am wondering if I should build a look-up table with two columns 'top_model' and 'model_limit' to create a limit boundary.

qty_table

top_model  | model_limit
-----------------|------------------
AB101       |    16

This would only need to be accessed where 'model' <> 'top_model'.

If 'model' = 'top_model' limit '1' else limit = model_limit from qty_table where 'top_model' = 'AB101'.

Yes, I am aware the syntax isn't accurate, just trying for brevity.

It seems it would be quite easy to parse the products table to build this fairly quickly.

Thank you for any and all feedback.

В списке pgsql-novice по дате отправления:

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: unrecognized configuration parameter "autocommit"
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Creating a limits table