Re: displaying repetitive results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 13 Nov 2004 06:30:14 +0000, Curt Zirzow
<php-general@xxxxxxxxxxxxxxxxx> wrote:

> > You might normalize the data a bit.
> 
> agreed!
> 
> Curt

My data IS Normalized! The results you are seeing below are from
joining together the books, subjects, and books_subjects xref table,
as I explained below. But my point is that because the data is
normalized, I end up with a result set that shows one row per subject,
making aggregate display of the subjects (so they appear as one set
for the user) painful...

Thus the tables and query I posted:

The query and tables are simple:

select books.id, books.title, subjects.subject
from books, subjects, books_subjects
where books_subjects.bid = books.id
and books_subjects.sid = subjects.id

BOOKS
1. collected poems of keats
2. spy high
3. sci-fi spies

SUBJECTS:
1. poetry
2. suspense
3. sci-fi
4. horror
5. mystery

BOOKS_SUBJECTS
bid  sid
1    1
2    2
3    2
3    3

c

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux