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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:11:21+00:00 2026-06-16T00:11:21+00:00

Given the table ticket with the primary key id and the table ticket_custom with

  • 0

Given the table ticket with the primary key id and the table ticket_custom with the composite key ticket,name how can I join for id = ticket and name=X and id = ticket and name=Y.

The table ticket_custom allows the ticket table to be extended, it has the fields ticket,name,value.

I can do a single join:

SELECT id, summary, owner, ticket_custom.value
FROM ticket
INNER JOIN ticket_custom
ON id=ticket_custom.ticket AND ticket_custom.name='X'

I need something like:

SELECT id, summary, owner, ticket_custom.value, ticket_custom.value
FROM ticket
INNER JOIN ticket_custom
ON id=ticket_custom.ticket AND ticket_custom.name='X' AND ticket_custom.name='Y'

Where the first ticket_custom.value is the value for id,x and the second is for id,y.

  • 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-16T00:11:21+00:00Added an answer on June 16, 2026 at 12:11 am

    If I understand correctly, this is what you are looking for:

    SELECT id, summary, owner, c1.value, c2.value
    FROM ticket t
    INNER JOIN ticket_custom c1  ON t.id = c1.ticket AND c1.name = 'X'
    INNER JOIN ticket_custom c2  ON t.id = c2.ticket AND c2.name = 'Y'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given: CREATE TABLE foo (id BIGINT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id)); I'd like to
Given table USER (name, city, age), what's the best way to get the user
How to write a PL/SQL procedure that: Copies a table given by name into
the code below returns the fields of a given table (Employee), but I need
I have Table in which We can have Same ticket no.for multiple entries.i want
given table: create table Person( Name varchar(100) ) where Name is unique for all
Given Table A Id INTEGER Name VARCHAR(50) Table B Id INTEGER FkId INTEGER ;
Given: Table y id int clustered index name nvarchar(25) Table anothertable id int clustered
given the first table ,i need to join this table with the same table
Given the following table, I know how to get the value of the first

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.