2番目のIDが最初のIDの最初の4文字と等しい2つのテーブルから選択したい
SELECT a.*, b.*, substring(a.my_id from 1 for 4)::integer as number
FROM table1 as a
INNER Join table2 as b ON(b.id_2=number) where my_id = 101
^
It produces an error here |
エラー: 列 "番号" が存在しません
SQL 状態: 42703
キャラクター: 189