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

The Archive Base Latest Questions

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

The SQL statement below used to work a few years ago, now it doesn’t

  • 0

The SQL statement below used to work a few years ago, now it doesn’t and I get this error message:

1054 – Unknown column ‘Promotion_Card_details.Card_id’ in ‘on clause’

This is my SQL statement:

SELECT DISTINCT Promotion_Card_details.Card_id, 
       Promotion_Merchant_details.Merchant_id, 
       Promotion_details.Promotion_id, 
       Issuer_details.IssuerName, 
       Card_details.CCType, 
       PaymentType_details.PaymentTypeName, 
       Merchant_details.MerchantName, 
       PromotionText, 
       PromotionEndDate 
FROM Promotion_details 
INNER JOIN Card_details ON (Card_details.Card_id=Promotion_Card_details.Card_id) 
INNER JOIN Issuer_details ON (Issuer_details.Issuer_id=Card_details.Issuer_id) 
INNER JOIN PaymentType_details ON (PaymentType_details.PaymentType_id=Card_details.PaymentType_id) 
INNER JOIN Merchant_details ON (Merchant_details.Merchant_id=Promotion_Merchant_details.Merchant_id) 
INNER JOIN Promotion_Merchant_details ON (Promotion_Merchant_details.Promotion_id=Promotion_details.Promotion_id) 
INNER JOIN Promotion_Card_details ON (Promotion_details.Promotion_id=Promotion_Card_details.Promotion_id) 
WHERE ((Promotion_details.Promotion_id = '13' OR Promotion_details.Promotion_id = '14'  
            OR 
      Promotion_details.Promotion_id = '15' OR Promotion_details.Promotion_id = '16' OR 
      Promotion_details.Promotion_id = '17' OR Promotion_details.Promotion_id = '18' OR 
      Promotion_details.Promotion_id = '19' OR Promotion_details.Promotion_id = '20' OR
      Promotion_details.Promotion_id = '21' OR Promotion_details.Promotion_id = '22' OR 
      Promotion_details.Promotion_id = '23' OR Promotion_details.Promotion_id = '24' OR 
      Promotion_details.Promotion_id = '25' OR Promotion_details.Promotion_id = '361' 
      OR Promotion_details.Promotion_id = '364' OR Promotion_details.Promotion_id = '382') )

Any help would be greatly appreciated as I have tried parentheses around certain parts, but it still hasn’t fixed it.

  • 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-29T12:20:08+00:00Added an answer on May 29, 2026 at 12:20 pm

    JOINs are left-associative, so a given ON clause can only refer to tables that have already been mentioned. So, reorder these:

    FROM Promotion_details 
       INNER JOIN Card_details ON (Card_details.Card_id=Promotion_Card_details.Card_id) 
       INNER JOIN Issuer_details ON (Issuer_details.Issuer_id=Card_details.Issuer_id) 
       INNER JOIN PaymentType_details ON (PaymentType_details.PaymentType_id=Card_details.PaymentType_id) 
       INNER JOIN Merchant_details ON (Merchant_details.Merchant_id=Promotion_Merchant_details.Merchant_id) 
       INNER JOIN Promotion_Merchant_details ON (Promotion_Merchant_details.Promotion_id=Promotion_details.Promotion_id) 
       INNER JOIN Promotion_Card_details ON (Promotion_details.Promotion_id=Promotion_Card_details.Promotion_id)
    

    into this order:

    FROM Promotion_details 
       INNER JOIN Promotion_Card_details ON (Promotion_details.Promotion_id=Promotion_Card_details.Promotion_id)
       INNER JOIN Card_details ON (Card_details.Card_id=Promotion_Card_details.Card_id) 
       INNER JOIN Issuer_details ON (Issuer_details.Issuer_id=Card_details.Issuer_id) 
       INNER JOIN PaymentType_details ON (PaymentType_details.PaymentType_id=Card_details.PaymentType_id) 
       INNER JOIN Promotion_Merchant_details ON (Promotion_Merchant_details.Promotion_id=Promotion_details.Promotion_id) 
       INNER JOIN Merchant_details ON (Merchant_details.Merchant_id=Promotion_Merchant_details.Merchant_id) 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to call the SQL statement below but get the following error: System.Data.SqlClient.SqlException:
I'm getting the error below for this SQL statement in VB.Net 'Fill in the
I have this SQL statement below INSERT into 2011_electricity ( date, energy, daynum) VALUES
I want to write an SQL statement like below: select * from tbl where
I have a problem with the SQL statement detailed below. The query returns the
I'm trying to do the below sql statement in GORM select * from table1
SQL statement: INSERT INTO order (`ORDER_ID`,`SALE_CODE`,`CREATED_AT`,`UPDATED_AT`) VALUES ('2646253286','HPHS20','2009-07-11 12:07:40','2009-07-11 12:07:40') Error: You have an
This SQL statement SELECT `ip`, `when` FROM `metrics` WHERE `vidID` = '1' GROUP BY
This SQL statement example is very close to what I think I need... update
Lately I've stumbled upon an error in a lib that used to work just

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.