Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. flyadvertising

    Multiple JOINS

    Thanks, that worked but the results are alternating instead of being combined into the same row. See below for simple example: users DB columns: uID | ufname 1 | John 2 | Mike matchmaker DB columns: mmparID | mmpreID 1 | 2 I want to show 'John' and 'Mike' in the same row in my...
  2. flyadvertising

    Multiple JOINS

    Having a problem combining 2 JOINS. Both statements below work. I have also included the relevant fields in the 2 DBs. My question is: 1) How do I combine the 2 statements into 1 statement? 2) How do I reference the rows in my php to distinguish if the result was from the mmpreID JOIN or the...
  3. flyadvertising

    aggregate function

    The query (B) below is working, but in the first LEFT JOIN I'd like to pull the most recent result. So, I'd have to add something like the query (A) below in somehow. A SELECT poArID, poDatetime FROM posts ORDER BY poDatetime DESC B SELECT articles.arID, articles.arType, articles.arTitle...
  4. flyadvertising

    Selecet DISTINCT plus one more

    Yes, that helps, thanks. Fortunately, pulling any of the purl values associated with that cID satisfies what I need to do. However, I will look at the aggregate function so I can make the query more accurate. Again, thanks for your help.
  5. flyadvertising

    Selecet DISTINCT plus one more

    This did it: SELECT ppre.cID, ppre.yr, ppre.make, ppre.model, ppre.vin, ppre.display, TR.purl FROM ppre INNER JOIN ( SELECT DISTINCT pcID, purl FROM ppics ) AS TR ON TR.pcID = ppre.cID GROUP BY ppre.cID Thank you
  6. flyadvertising

    Selecet DISTINCT plus one more

    Right, an extra column. However, the SQL you provided shows all the results (not right). My original statement showed just the distinct TR.pcID's (right), but I am just trying to pull in the associated value from the ppics.purl in the same row as the TR.pcID. Sorry if I am not being clear.
  7. flyadvertising

    Selecet DISTINCT plus one more

    I'd like to return ppics.purl
  8. flyadvertising

    Selecet DISTINCT plus one more

    The following is working great, but I need to get one more row from the second table (ppics). However, when I try to add this in, my query stops working. Any help will be much appreciated. SELECT ppre.cID, ppre.yr, ppre.make, ppre.model, ppre.vin, ppre.display FROM ppre JOIN (SELECT DISTINCT...

Part and Inventory Search

Back
Top