0

以下是我的查询:

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**")

我应该将 xalue of school_grade_class_id从替换为结果集 v getdata1。我该怎么办?

4

1 回答 1

2

你可以这样做:

getdata1.each{
    println it.student_id
}

或者

sql.eachRow("select student_id,school_grade_class_id from class_assign", {
   println it.student_id
})
于 2013-04-06T05:30:55.313 回答