sql - What does displaying first name and last name in ascending order together means? -
here question : "list course id, course name, section, student id, , student name crn 1003. display list in ascending order of student last , first names."
my question:
since need display list in ascending order of student last name , first name. i'm wondering how can achieve both in 1 order clause? have written following query:
select a.cid, a.cname, b.sid, b.lname,b.fname, c.section,c.crn courses a, students b, sections c, registration d a.cid = c.cid , b.sid = d.sid , c.crn = d.crn , c.crn = 1003 ; order b.lname asc;
in above query, can't include b.fname along b.lname. please correct me if i'm wrong somewhere. i'm confused last line of question "display list in ascending order of student last , first names"
thanks
you can specify multiple columns in order by
:
... order b.lname asc, b.fname asc;
Comments
Post a Comment