View Full Version : help help help


choti
10-09-2001, 06:58 AM
in my db i have a restaurant table which has fields such as name, street, town, postcode etc. there is another table (contacts) which has phone, fax, email as fields. the relationship between this is 1-many. if i run a query of restaurant and contacts, the same restaurant may appear as many times as there are contacts
eg macdonalds - 020 89535522
macdonalds - 020 89654444
macdonalds - 020 86542222
how can i design my query so that the name appears once with the appropriate numbers. i am using the query for asp so do i design the query to show the correct results or is it in the asp page??

much appreciated

choti

ps i want an output such as :

macdonalds 020 895554444
020 895554443
020 893555111

I appreciate all help receive so far but basically it is for a website using asp where i need to display a restaurant and relevant details appropriately!

jonnycattt
10-09-2001, 07:10 AM
use the sql aggregate function "group by" in your sql statement. your asp books should tell you what to do with this when you output it. it's probably something like

#RestaurantName#
#Restaurant Value#

where the # represent whatever asp's variable naming convention is.