Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
froggy
Starting Member
14 Posts |
Posted - 2006-10-18 : 21:35:54
|
| Hi, I am having some troubles with the syntax of my SQL statement to fit them into a certain layout. Would appreciate if anyone can provide me with advise. In my database, i have 5 fields ( nameid, name, number, section, role) Each person is only assign 1 role(A, B or C). In my webpage, the list is to display the name, id, number and role each person play based according to the different sections. Thus in the website there are 4 columns(Role, Name, Nameid, Number). However,I would like to include an additional row to display the name of the sections thus will have to insert rows in betweens the names whenever there is a new section.Eg.Role, Name, Nameid, NumberSection XA, mary, 1111, 1234567C, sally, 1112, 7654321Section YB, ken, 1113, 2345678B, bob, 1114, 8765432 |
|
|
snSQL
Master Smack Fu Yak Hacker
1837 Posts |
Posted - 2006-10-18 : 21:51:01
|
| You'll need to handle that in the code that generates the web page. Show the section name of the first record, then display all records until the section name changes, then show the section name and keep repeating that.So your SELECT query must just return all the rows you want ordered by section name first, then by any columns you want to sort the rows within the sections on. |
 |
|
|
DonAtWork
Master Smack Fu Yak Hacker
2167 Posts |
Posted - 2006-10-19 : 07:16:44
|
Layout = Format = Front End = Madhi [Signature]For fast help, follow this link:http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspxLearn SQLhttp://www.sql-tutorial.net/ http://www.firstsql.com/tutor.htm http://www.w3schools.com/sql/default.asp |
 |
|
|
|
|
|
|
|