table joins to create a query

Results 1 to 2 of 2

Thread: table joins to create a query

  1. #1
    gus Guest

    Default table joins to create a query

    Hi, Ive got four tables to join to do some back end administration on my database it will have to be done in ASP in web interface...the 4 tables in question are tblCDs: CDID, FirstName,LastName,Title,PointValue.<BR>OrderDetai ls:CDID,OrderID,TimeAdded<BR>tblOrders:OrderID,Use rName,OrderDate<BR>Members:UserName,EmailAddress,F irstName,LastName<BR>My first admin page will have something like "Browse Orders by OrderDate" and the result table will have headings as follows<BR>OrderDate,OrderID,EmailAddress,No.ofPoi ntValuesinOrder,No.ofCDsinOrder,Detail(to look at specifics),Delete.<BR>Now, I have been told this is not possible because of the intersection table OrderDetails which appears between tblCDs and tblOrders. Can anyone tell me if this can or cant be done like Ive stated. Otherwise Ill have to modify everything, which I dont want to do if possible. I hope Ive given enough information!! (tblOrders-OrderDetails)1 to many relationship, (OrderDetails-tblCDs)1 to 1....that is how I think it works...<BR>thanks<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: table joins to create a query

    Hope it will help...<BR>Select cd.CDID,cd.FirstName,cd.LastName,cd.Title,cd.Point Value,o.CDID,o.OrderID,o.TimeAdded,t.OrderID,t.Use rName,t.OrderDate,m.UserName,m.EmailAddress,m.Firs tName,m.LastName <BR>From tblCDs cd,OrderDetails o,tblOrders t,Members m<BR>Where cd.CDID=o.CDID and o.OrderID = t.OrderID and t.UserName=m.UserName

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts