-
Simple multi-table select and sort
This is feeling very hard for me, but is surely very easy for many of you.
I have 2 Tables. "Events" and "Meals". Both have a columns named "EventDate" and "EventTime". I need to be able to compile a list of both and sort by event date and time. For example, a Meal @ 5:30 would place itself between a 4:00 Event, and a 6:30 Event.
PLEASE HELP ME!!!
Pending deadline doom
Thanks,
kaskenasy@publishingconcepts.com
-
Simple multi-table select and sort (reply)
try this
1- select the columns you need from both tables i.e
select a.event,a.eventDate,a.eventTime,b.meal into new_table_name
from Events a,Meals b where a.id_column=b.id_column
id_column is the name of the same id column in both tables.
then do a group by. i.e
select meal,eventdate,eventtime from new_table_name group by meal,eventdate,eventtime order by eventtime.
this just an example of group by, but you can use any fields
you like to sort by.
------------
Karridy Askenasy at 2/10/2002 6:48:29 PM
This is feeling very hard for me, but is surely very easy for many of you.
I have 2 Tables. "Events" and "Meals". Both have a columns named "EventDate" and "EventTime". I need to be able to compile a list of both and sort by event date and time. For example, a Meal @ 5:30 would place itself between a 4:00 Event, and a 6:30 Event.
PLEASE HELP ME!!!
Pending deadline doom
Thanks,
kaskenasy@publishingconcepts.com
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|