question about SQL query and cfoutput with INNER JOIN

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default question about SQL query and cfoutput with INNER JOIN

    I have a query that pulls data from two related tables (an Article Table and a
    Photo table, linked by ArticleID) Lets say i have 3 photos that are related to
    aricleID 1 (articleid is unique and there is only one article with that ID).
    when i run the query i get 3 rows returned, this is becuase there is 3 photos.
    Now, i want to output that data in a cfoutput but when i do i get 3 records
    written to the page. My questions is; how do i supress the article from being
    output 3 times but allow me to output all 3 associated photos?

    Hope this makes sense
    thanks!
    nf

    Sample Query
    SELECT Articles_MyGVegas.ArticleID, Articles_Photo.PhotoID,
    Articles_Photo.Photo_Name, Articles_MyGVegas.Headline
    FROM Articles_MyGVegas INNER JOIN
    Articles_Photo ON Articles_MyGVegas.ArticleID =
    Articles_Photo.ArticleID

    Output
    articleID headline photoid
    1 test 6
    1 test 7
    1 test 8

    nedflanders Guest

  2. Similar Questions and Discussions

    1. INNER JOIN query question
      I have 2 tables with the following columns (other data fields omitted for brevity): cases.caseid cases.uid profiles.uid profiles.locationid...
    2. CFOUTPUT QUERY rowcount = 0
      Hello, I have a query which return 0 row. I have a CFOUTPUT QUERY which try to output my query. Coldfudion enter in the CFOUTPUT once EVEN if my...
    3. <cfoutput query> and TABLE formatting
      HI, I'm trying to output images from a database using <cfoutput query>. That part works fine. But the images display all in one column, one...
    4. Query, view join question.
      Hi Tom, I could give you access to the database itself if needed. But these are the actual tables and view. I hope I will never make any tpo's...
    5. Query, view join question.
      Hi all, I have 2 tables: table1 with the columns objectid, refobjectid, commonvaluecol and value1. table2 with the columns objectid,...
  3. #2

    Default Re: question about SQL query and cfoutput with INNERJOIN

    Have you tried the grouping attribute for cfoutput? that may work.
    rmorgan Guest

  4. #3

    Default Re: question about SQL query and cfoutput with INNERJOIN

    alright, thats it.
    Thanks!
    nedflanders 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