0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ばんえい競馬の含水率を取得する

Last updated at Posted at 2025-11-30

注意

この記事は独自に調べた結果のため誤っている可能性があります

前提

「PC-KEIBA」 と 「地方競馬DATA」で地方競馬のデータをPostgresに取り込んでいるものとします。

「PC-KEIBA」と「地方競馬DATA」については下記の記事で紹介しています
https://qiita.com/masachaco/items/5b3f4bcb3d133f2e6f5f

含水率を取得する

nvd_ra (レース詳細)テーブルの
babajotai_code_shibababajotai_code_dirt を結合する。
2桁の16進数になるので、それを10進数に変換し、10で割った値が含水率になる。

SELECT
    race_bango,
    (('x'||(babajotai_code_shiba || babajotai_code_dirt))::bit(8)::integer) / 10.0 含水率
FROM
    nvd_ra
WHERE
    keibajo_code = '83'
    and kaisai_nen = '2024'
    and kaisai_tsukihi = '0720'
ORDER BY race_bango asc

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?