i execute following sql code, want "parent.name,child.name", value of returned list "parent.name,parent.name"? help? database mysql
string sql = "select parent.name,child.name category parent,category child child.category_id=7 , child.sub_type in (80,81) , child.parent_id=parent.id;"; query query = session.createsqlquery(sql); return query.list();
the desired result:
parent.name child.name d b e c f
the current result:
parent.name child.name b b c c
by way, can right result in sqlyog client executing sql.
first of all, it's ensured sql statement correct via description, , object array following:
for(object[] obj : results) { obj[0] // parent name obj[1] // child name }
maybe you:)
Comments
Post a Comment