Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default JOIN operators

    I am querying 2 datasets at once, my first data set is a customers table and
    the second is a list of contacts for each customer record. my problem is that
    when i search this combined dataset, the results only show those customers who
    also have a linked record in the contacts table.

    Not all customers have contacts listed and have no linked records at all in
    the contacts table, so when querying my dataset if i want to search by customer
    name alone I effectivley can only search those customers with contacts.

    Any help would be greatly appreciated as this is clowing down my development
    time considerably.

    jt_advance Guest

  2. Similar Questions and Discussions

    1. Is left-join faster then inner join?
      Some people said that using left-join is generally faster than inner join, is that true? Thanks...
    2. Operators
      Hi everyone, I have lost touch with Flash for quite some time, so there's alot of stuff I do not really understand. Can anyone tell me what...
    3. [PHP-DEV] regex operators
      I was thinking about adding one or two regex-related features to the engine: 1. "preg_case": this would behave just like case but instead of doing...
    4. [PHP-DEV] O.T. [PHP-DEV] regex operators
      Warning: reply is O.T. Adam Maccabee Trachtenberg wrote: "don't see people advocating ..." - Here in php-internals? Read comp.lang.lisp :) I...
    5. What are the !== and === operators for?
      I have seen code with the !== and === operators in it and got confuzed. WTF are those for I asked myself. So I looked around PHP.net... To no...
  3. #2

    Default Re: JOIN operators

    Hi,

    SELECT * FROM
    Customers C LEFT OUTER JOIN Contacts Co ON C.CustomerID = Co.CustomerID

    Left outer join pulls all records from customers and shows contacts only
    when they exist.

    Jon



    "jt_advance" <webforumsuser@macromedia.com> wrote in message
    news:d2ec70$qd2$1@forums.macromedia.com...
    >I am querying 2 datasets at once, my first data set is a customers table
    >and
    > the second is a list of contacts for each customer record. my problem is
    > that
    > when i search this combined dataset, the results only show those customers
    > who
    > also have a linked record in the contacts table.
    >
    > Not all customers have contacts listed and have no linked records at all
    > in
    > the contacts table, so when querying my dataset if i want to search by
    > customer
    > name alone I effectivley can only search those customers with contacts.
    >
    > Any help would be greatly appreciated as this is clowing down my
    > development
    > time considerably.
    >

    Jon Spivey Guest

  4. #3

    Default Re: JOIN operators

    hi thanks for your quick response.

    I've tried this query in an SQL database and it works fine, however when i
    write it into my dreamweaver code the results appera as before where only
    customers with contacts are displayed.

    would there be something else in my code i needed to change?

    jt_advance Guest

  5. #4

    Default Re: JOIN operators

    here is the code i am using for this query




    SELECT Account, Customer, Name AS ConName FROM Customers LEFT OUTER JOIN
    Customers_Contacts ON Customers.ID = Customers_Contacts.CustomerID WHERE Name
    LIKE ?

    jt_advance Guest

  6. #5

    Default Re: JOIN operators

    If Name is from the Contacts table, then your outer join doesn't do any
    good. It will keep the customers with no contacts initially, but they'll be
    discarded by the where clause because the contact name doesn't match your
    filter.

    --
    -------------------------------------------------------------------
    You must SHOW YOURSELF to e-mail me. No cowards allowed!




    "jt_advance" <webforumsuser@macromedia.com> wrote in message
    news:d2ei5d$66r$1@forums.macromedia.com...
    > here is the code i am using for this query
    >
    >
    >
    >
    > SELECT Account, Customer, Name AS ConName FROM Customers LEFT OUTER JOIN
    > Customers_Contacts ON Customers.ID = Customers_Contacts.CustomerID WHERE
    Name
    > LIKE ?
    >

    Lionstone Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139