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 9250245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:24:08+00:00 2026-06-18T10:24:08+00:00

I was just wondering if anybody would be able to help me with a

  • 0

I was just wondering if anybody would be able to help me with a SQL join as I’m fairly new to MySQL. I’m looking to join two tables, here my tables and what I’m looking for the end result to look like, thanks in advance!

TABLE ARTICLES 
article_id    title    body            date       category     author
1             Lorem    Lorem ipsum..   1/1/2013   1            Mitchell

TABLE CATEGORIES
category_id   category
1             Web Design

SQL STATEMENT

select categories.category_id, categories.category as category
from categories left outer join articles on categories.category = articles.category

SQL RESULT I’M LOOKING FOR

article_id    title    body            date       category     author
1             Lorem    Lorem ipsum..   1/1/2013   Web Design   Mitchell
  • 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-06-18T10:24:10+00:00Added an answer on June 18, 2026 at 10:24 am

    Your joining ON condition should be between categories.category_id and articles.category. Otherwise, you just need to add more columns to your SELECT list, as you’re nearly there.

    SELECT
      article_id,
      title,
      body,
      date,
      categories.category,
      author
    FROM
      articles
      LEFT JOIN categories ON articles.category = categories.category_id
    

    Here it is in action: http://sqlfiddle.com/#!2/0e0c1/1

    I note that you have listed your date in the format m/d/yyyy here instead of YYYY-MM-DD which is MySQL’s default output. If that is indeed how you have stored it in your table (as a VARCHAR() rather than a proper DATE type), I would recommend changing that strategy before you get too far into the project to change it easily.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was just wondering, why would anybody write this: std::iter_swap(i, k); instead of this?
Hi i was just wondering if anybody could help me i am reading characters
I am just wondering if anybody sees any error here, the code executes but
Just wondering if anybody has run Scala app or web-app on Java Real-Time system?
Im just wondering if theres a recommended syntax validator out there anybody can recommend?
just wondering when I had an iphone I was able to create a web
I'm just wondering if anybody has any good game score algorithms based on REMAINING
Was just wondering if anybody knows how to remove an empty changelist from perforce
Just wondering if anybody has come across a tool or anything to make the
i was just wondering if anybody knows how to detect what is calling the

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.