Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3781210
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:54:48+00:00 2026-05-19T10:54:48+00:00

I have 2 tables – one with articles , and one with article related

  • 0

I have 2 tables – one with articles, and one with article related photos. Each article can have none, one or multiple photos related to it (article_id as foreign key)

Query I use to fetch data is:

SELECT articles.article_id, articles.article_text article_photos.photo_filename
FROM articles, article_photos
WHERE article_photos.article_id = articles.article_id

And it returns to me all data + 1 photo_filename.

Question is, when 2 or more photos are related to article, how do I read them?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:54:48+00:00Added an answer on May 19, 2026 at 10:54 am

    It will replicate the same row from articles, but different row from article_photos

    such as

    select articles.article_id, articles.article_text, article_photos.photo_filename
    from
      articles
    left join article_photos
    on article_photos.article_id=articles.article_id
    
    >>> results
    1,some_text,photo1.jpg
    1,some_text,photo2.jpg
    1,some_text,photo3.jpg
    2,some_text2,NULL       --> no photo related
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tables with listings, categories and one that maps them to each other.
I have tables of data samples, with a timestamp and some data. Each table
I have tables foo and bar: create table foo(a int, b varchar(10), primary key
So I have two tables in this simplified example: People and Houses. People can
If all tables I want to delete from have the column gamer_id can i
In my database I have tables that define types for example Table: Publication Types
When I have tables in my database that have PK/FK relationships (int) and when
Using MS Access 2007, I am creating a student management database. I have tables
I have several tables whose only unique data is a uniqueidentifier (a Guid) column.
I have three tables: page, attachment, page-attachment I have data like this: page ID

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.