s
i have table contain 3column(student_id,student_name,department) and multiple row
i need a sql statment
to return the first five student that study english
and i work on windowsapplication in vs 2008 c#
Web Development
i have table contain 3column(student_id,student_name,department) and multiple row
i need a sql statment
to return the first five student that study english
and i work on windowsapplication in vs 2008 c#
by awadaa Accepted solution
by tony hopkinson Accepted solution
select top 5 * From sutudents where department = 'English'
or some such.
If yu wanted the first five alphabetically then add
order by student_name to it, may be
by awadaa Accepted solution
thank u very much
it is right
by awadaa Accepted solution
by tony hopkinson Accepted solution
by awadaa Accepted solution
i dont understand
i want the last two student
in the same table
by tony hopkinson Accepted solution
worked then instead of just copying it and then asking me the next question in your f'ing homework.
If you have a table called sillytable with one column in it called sillynumber and it has 100 rows containing 1 to a 100 then
select Top 2 from sillytable order by sillynumber
would return records 1 and 2, because 1 1n 2 are the first two records in silly number order
So
select Top 2 from silytable order by sillynumber desc
would return reords 100 and 99 because they are the first two if you sort in descending order.
Most recent student presumably from what you've posted would the two with the biggest ids.
Not being funny but I don't think you are cut out for theis techy stuff. By all means prove me wrong, but you aren't going to do so unless you get your arse in gear.
If you can't figure it out from what I've just posted, give up now.
This discussion is closed to new replies.
Sort by Trending