Tutti Nuovi

user:thomas utente che ha creato il gist

title:mygist titolo del gist

filename:myfile.txt nome di file nel gist

extension:yml estensione del file nel gist

language:go linguaggio del file nel gist

topic:homelab gists with given topic

Entra


Tutti Nuovi Entra

All gists matching topic for-json

Più recente creazione
Meno recente creazione
Più recente aggiornamento
Meno recente aggiornamento

timmy / 🧾 SQL Server 輸出 JSON:FOR JSON PATH 超簡單上手

0 mi piace
0 forks
1 files
Ultima volta attivo 8 months ago
用 SQL Server 直接產出 JSON,支援巢狀資料結構與根物件命名,後端串接 REST API 不再痛苦 🙌
data-api for-json json-output sql-query sql-server sql-tips
1 SELECT id, name, age -- 選取 id、name 和 age 欄位
2 FROM YourTable -- 從 YourTable 查詢
3 FOR JSON PATH; -- 以 JSON 格式輸出,允許自訂 JSON 結構
4
5 SELECT id, name, age -- 選取 id、name 和 age 欄位
6 FROM YourTable -- 從 YourTable 查詢
7 FOR JSON PATH, ROOT('Users'); -- 以 JSON 格式輸出,並加上 "Users" 作為根物件
Più nuovi Più vecchi

Creato da Opengist ⋅ Load: 18ms⋅

Italiano
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文