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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-07-18 : 11:55:13
|
| Gareth writes "Dear Sir/MadamI currently have a books table with the following fields.Book_IDAuthor_NameWhen I select from books I want it to select by book_id but the same author can never be subsequenteg: Roald Dahl 1 John Steinbeck 3 Roald Dahl 2 John Steinbeck 5 Roald Dahl 4Any ideas how I can do thisThanks" |
|
|
simondeutsch
Aged Yak Warrior
547 Posts |
Posted - 2002-07-18 : 15:46:02
|
| Do you want to ORDER BY authors? Or GROUP BY? You can't Group by authors unless you get some aggregate for Book_ID, which doesn't make much sense. Your sample has no order- to order by authors say ORDER BY Author after the WHERE clause, or Book_ID.Sarah Berger MCSD |
 |
|
|
M.E.
Aged Yak Warrior
539 Posts |
Posted - 2002-07-18 : 16:29:41
|
| Only way I can see this happening is with a cursor and a whole loatta unions.-----------------------Take my advice, I dare yaEdited by - M.E. on 07/18/2002 16:30:17 |
 |
|
|
|
|
|