0

hello guys,

i wanted to write a query, or a view to be exact to display data from two tables as follow:

1. schedule_table (scheduleID as pk)
2. remarks (remarkID as pk, scheduleID as fk)

meaning a schedule can contain many many remarks and non at all.

now the problem is i want to display the data in one line. for example:

1. scheduleID remark1, remark2, remark3, remark4.
2. scheduleID remark1, remark2
3. scehduleID

how do i go about doing this?

regards.
ch

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by gp04lch
0

Whole point of normalisation is to never have tables like this... Don't think that it is possible to do this in SQL unless you know what is maximal number of remarks for a schedule (ie. not greater than 3). If this is true you can do a series of inserts into temporary tables (ie. remark1, remark2, etc.) and then join them together.

0

thanks. i think i'll think about it and change the table structure.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.