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

  • Home
  • SEARCH
  • 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 7659503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:20:29+00:00 2026-05-31T13:20:29+00:00

node id title content type 47 test foobar 1 type id name 1 blog

  • 0

node

id title content type
47 test  foobar  1

type

id name
1  blog

output

id title content type
47 test  foobar  blog

using the following query doesn’t seem to be working…

 SELECT a.id, a.title, a.content, a.type
        FROM node a
        WHERE a.id = '. $id .'
        JOIN type b
        ON 
            a.type = b.id

how should I write this query to get the output I want?

  • 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-31T13:20:30+00:00Added an answer on May 31, 2026 at 1:20 pm

    You are almost there. You only need to place the WHERE condition last

        SELECT a.id, a.title, a.content, a.type
        FROM   node a
               JOIN type b ON a.type = b.id
        WHERE  a.id = '. $id .'
    

    One remark and a personal preference, but I’d like to explicitly indicate the JOIN type to remove any doubts for people maintaining the code.

        SELECT a.id, a.title, a.content, a.type
        FROM   node a
               INNER JOIN type b ON a.type = b.id
        WHERE  a.id = '. $id .'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a content type including two fields: First name(node title) and Last name(text
is possible to rename the node title using the value from the java script
I have a mysql query SELECT content_type_clients.nid, content_type_clients.field_logo_display_value, files.filepath, node.title, node.created FROM content_type_clients, files,
I've got two content types, both have a node title and a document attachment,
Imagine I define video-type node, which displays for example a title and description, along
I have created a view to list the page content type(title, teaser and image)..
What am I doing wrong. I can't seem to pull based upon content type
As per the title, is this possible? By tri-state, I mean the parent node
Does DOM API provide HTMLTitle Object that implements Node interface? document.title returns only string
I have a content type Audio which includes an audio file field. This field

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.