PostgreSQL遍歷Json

數據源:

 

SQL:

SELECT
	orderno,
	fromno,
	fromamount,
	fromlotno ->> 'index' fromlotno,
	othercondition ->> 'supplicode' supplicode,
	othercondition ->> 'downcode' downcode,
	othercondition ->> 'spec' spec,
	othercondition ->> 'carport' carport
FROM
	(
		SELECT
			orderno,
			fromno,
			fromamount,
			json_array_elements (fromlotno) fromlotno,
			json_array_elements (othercondition) othercondition
		FROM
			t_feather_source
	) A

輸出結果:

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章