Chi Yau ☕️

Chi YauChi Yau

App Dev

ShareChiWai

Professional Summary

I’m Chi, a passionate tech enthusiast exploring the latest innovations in GenAI, LLMs, web development, performance tuning, and cybersecurity. As a tech guy at a startup, I aim to share my experiences, insights, and lessons learned in the fast-paced world of technology. Join me on this journey as we dive into the exciting challenges and triumphs of building and scaling tech solutions!

Interests

Performance Tuning Building Tech Innovation
Blog

How to query json field in Postgresql

JSON 是一種常見的數據格式,Database 已經可以支援儲存同Query JSON 數據類型

今日就要係postgresql 度query 個 JSON field 睇返D log 同埋做返D data analysis

如何query JSON field in PostgreSQL 呢?

PostgreSQL 提供了兩個主要的操作符來查詢 JSON 數據:

  • -> - 獲取 JSON 對象欄位(返回 JSON 類型)
  • ->> - 獲取 JSON 對象欄位(返回 TEXT 類型)

查詢範例

假設我們有一個 users 表,其中 profile 欄位是 JSONB 類型: