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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:38:36+00:00 2026-06-15T14:38:36+00:00

table structure: SELECT p.id id, p.type TYPE , v.provider provider, v.video_id video_id, NULL content,

  • 0

table structure:
enter image description here

SELECT p.id id, p.type
    TYPE , v.provider provider, v.video_id video_id, NULL content, NULL url, NULL posted_by
    FROM post p
    INNER JOIN p_video v ON p.id = v.id
    AND p.type =  'video'
    UNION 
    SELECT p.id, p.type, NULL , NULL , t.content, NULL , NULL 
    FROM post p
    INNER JOIN p_text t ON p.id = t.id
    AND p.type =  'text'
    UNION 
    SELECT p.id, p.type, NULL , NULL , NULL , i.url, NULL 
    FROM post p
    INNER JOIN p_image i ON p.id = i.id
    AND p.type =  'image'
    UNION 
    SELECT p.id, p.type, NULL , NULL , NULL , l.url, NULL 
    FROM post p
    INNER JOIN p_link l ON p.id = l.id
    AND p.type =  'link'
    UNION 
    SELECT p.id, NULL , NULL , NULL , NULL , NULL , u.name
    FROM post p
    LEFT JOIN user u ON p.user_id = u.id
    ORDER BY id DESC 
    LIMIT 0 , 30

mySQL output

What’s my syntax error? It just makes 2 rows.. but I want all the output in seperate 1 rows.

  • 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-15T14:38:37+00:00Added an answer on June 15, 2026 at 2:38 pm

    try this

    SELECT p.id id, p.type
    TYPE , v.provider provider, v.video_id video_id, NULL content, NULL url, u.name posted_by
    FROM post p
    LEFT JOIN user u ON p.user_id = u.id
    INNER JOIN p_video v ON p.id = v.id
    AND p.type =  'video'
    UNION 
    SELECT p.id, p.type, NULL , NULL , t.content, NULL , u.name
    FROM post p
    LEFT JOIN user u ON p.user_id = u.id
    INNER JOIN p_text t ON p.id = t.id
    AND p.type =  'text'
    UNION 
    SELECT p.id, p.type, NULL , NULL , NULL , i.url, u.name
    FROM post p
    LEFT JOIN user u ON p.user_id = u.id
    INNER JOIN p_image i ON p.id = i.id
    AND p.type =  'image'
    UNION 
    SELECT p.id, p.type, NULL , NULL , NULL , l.url, u.name
    FROM post p
    LEFT JOIN user u ON p.user_id = u.id
    INNER JOIN p_link l ON p.id = l.id
    AND p.type =  'link'
    ORDER BY id DESC 
    LIMIT 0 , 30
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an table structure like this mysql> SELECT id, name, parent_id FROM categories;
Please consider following sample table structure: +-------------------------------+--------------+------+-----+---------+-------+ | Field | Type | Null |
SELECT r.game, u.username, r.userid, r.points, u.format FROM .TBL_RANKING. r INNER JOIN .TBL_USERS. u ON
Table structure: +-------------+----------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default |
I have the following table structure: +----------+------------------------+------+-----+------------------------------------------+----------------+ | Field | Type | Null |
I execute a select to get the structure of a table. I want to
team = hxs.select ('//table[@class=tablehead/tbody/tr[contains[.@class, player]') The structure of the web site I whose table
My table structure is below: CREATE TABLE [ACC].[Document]( [DocumentID] [int] IDENTITY(1,1) NOT NULL, [Date]
I have the following table structure. I want to select distinct CustomerId and CustomerName
Table structure: CREATE TABLE `mytable` ( `id` varchar(8) NOT NULL, `event` varchar(32) NOT NULL,

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.