以下是我的询问:
def getdata1 = sql.rows("select student_id,school_grade_class_id from class_assign")
如何从student_id
获取getdata1
?
更新
def getdata1 = sql.rows("select student_id,school_grade_class_id from class_assign")
def getdata2 = sql.rows("select class_id,class_name,school_grade_id from class_rel where school_grade_class_id=**x**")
我应该从alue of school_grade_class_id
将x替换为结果集v getdata1
。
我该怎么办?
答案 0 :(得分:2)
您可以这样做:
getdata1.each{
println it.student_id
}
或者
sql.eachRow("select student_id,school_grade_class_id from class_assign", {
println it.student_id
})