如何使用SQL Server 2016检索JSON对象的键和值

时间:2018-08-01 07:37:07

标签: json

例如,如果我有一个表Class,它由两列class_id,stud_list组成,并插入一行,如下所示:

INSERT INTO STUD_CLASS VALUES('10001000', N' [{
  "ID":1,       
  "FirstName":"Manoj",       
  "LastName":"Pandey",       
  "Class":10,       
  "Marks":80.5    
},    
{         
  "ID":2,       
  "FirstName":"Saurabh",       
  "LastName":"Sharma",       
  "Class":11,       
  "Marks":82.7    
},    
{         
  "ID":3,       
  "FirstName":"Kanchan",       
  "LastName":"Pandey",       
  "Class":10,       
  "Marks":90.5    
},    
{         
  "ID":4,       
  "FirstName":"Rajesh",       
  "LastName":"Shah",       
  "Class":11,       
  "Marks":70.3    
},    
{         
  "ID":5,       
  "FirstName":"Kunal",       
  "LastName":"Joshi",      
  "Class":12,       
  "Marks":64.7    
}'
)

如何使用sql server 2016检索学生信息?

0 个答案:

没有答案