我将数据存储在android的本地会议室数据库中。
[
{
id:1
name: Dhiraj kumar
phone:1234567
email:test@test.com
school: DAV
},
{
id:2
name: Niraj kumar
Phone:2453465345
email:test@test.com
school: DAV
},
{
Id:3
name: some name
Phone:134245
email:test@test.com
school: DAV
},
{
Id:4
name: Sumanth
Phone:134245
email:test@test.com
school: summer vila
},
{
Id:3
name:Raghav
Phone:134245
email:test@test.com
school: summer vila
}
]
我想获取所有学生名单中的学校名单
ex:
[{
"school": DAV
"students":
[
{
id:1
name: Dhiraj kumar
phone:1234567
email:test@test.com
school: DAV
},
{
id:2
name: Niraj kumar
Phone:2453465345
email:test@test.com
school: DAV
},
{
Id:3
name: some name
Phone:134245
email:test@test.com
school: DAV
}
]
},
{
"school":summer villa
"students"[
{
Id:4
name: Sumanth
Phone:134245
email:test@test.com
school: summer vila
},
{
Id:3
name:Raghav
Phone:134245
email:test@test.com
school: summer vila
}
]
}
]
当前,我正在获取不同的学校名称,然后运行循环,然后获取学校为schoolName
的学生名单。
但是我想知道,如何使用查询获取数据?有可能吗,或者分离数据的最佳方法是什么?