I have two tables: Orders and Appoitment. Each order can have up to 2 appointments. Now, I need a SELECT statement that gives me this:
1 appt1 appt2
2 appt1 appt2
and not this:
In other words, I want to merge the two appointments for each order. I tried using the merge statement but it does not work. Tried to google but saw nothing. My database is SQL server. Please help. Thanks
Last edited by phamtranquocvie; 12-28-03 at 06:50.
I second Brett's concern. How do you guarantee only two appointments per order? If there is a field in each record that indicates the "type" of appointment, such as 'Initial', 'FollowUp', then you should consider using a cross-tab query because it is more flexible. If there is not, then Brett's solution is probably the only way to go.