<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>vyx02237</author_name>
  <author_url>https://blog.hatena.ne.jp/vyx02237/</author_url>
  <blog_title>作業日記</blog_title>
  <blog_url>https://vyx02237.hatenadiary.org/</blog_url>
  <categories>
    <anon>postgresql</anon>
  </categories>
  <description>商品の出荷にあたって、価格からどれだけの値引きを行うかということは、業務上様々な条件があって、かつそれが固定的でなく変動することもある。いろいろな方法を試してみましたが、現在は以下の方法でやっています。１ 正味を決定する条件を羅列するテーブルを用意 このテーブルに、条件となる項目を列として用意しておいて、その条件のプライオリティをしめす列を付けておく。 ２ 条件となる各列は、条件が適用されない場合はナルにしておく。 ３ 条件を網羅して渡す pl/pgsql 関数を作成。条件網羅テーブルをプライオリティ逆順でループして最初に全ての条件を満たした行の適用正味を返す。 ４ pl/pgsql 関数にし…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fvyx02237.hatenadiary.org%2Fentry%2F20111126%2F1322323129&quot; title=&quot;正味を決定する pl/pgsql 関数 - 作業日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2011-11-26 00:58:49</published>
  <title>正味を決定する pl/pgsql 関数</title>
  <type>rich</type>
  <url>https://vyx02237.hatenadiary.org/entry/20111126/1322323129</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
