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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:12:47+00:00 2026-05-23T17:12:47+00:00

I am trying to get the column values form different tables included in below

  • 0

I am trying to get the column values form different tables included in below query but when i am checking diferent conditions in where clause it gives error.

                                  sql = @"SELECT members.member_Id, members.member_Lastname, members.member_Firstname, members.member_PostCode";
  sql += "," + "members.member_Reference,  members.member_Dob, members.member_IsBiometric, mshiptypes.mshipType_Name, mshipstatustypes.mshipStatusType_Name";
  sql += "," + "membertomships.memberToMship_EndDate";
  sql += " "+"FROM members LEFT JOIN membertomships ON membertomships.member_Id = members.member_Id";
  sql += " "+"LEFT JOIN mshipstatustypes ON mshipstatustypes.mshipStatusType_Id = membertomships.mshipStatusType_Id";
  sql += " "+"LEFT JOIN mshipoptions ON mshipoptions.mshipOption_Id = membertomships.mshipOption_Id";
  sql += " "+"LEFT JOIN mshiptypes ON mshiptypes.mshipType_Id = mshipoptions.mshipType_Id";
  sql += " " + "WHERE memberToMship_PayMethod='Cash' AND  mshipStausType_Name ='Live' AND  mshipStatusType_Name = 'Defaulter'  AND mshipStatusType_Name='Frozen'";

but it was giving error like this

                          Error Code: 1054
                          Unknown column 'mshipStausType_Name' in 'where clause'

can any one help me on this i am using mysql…

this si the modified query but it does not pull ant data it was giving empty column values

                                              sql = @"SELECT members.member_Id, members.member_Lastname, members.member_Firstname, members.member_PostCode";
  sql += "," + "members.member_Reference,  members.member_Dob, members.member_IsBiometric, mshiptypes.mshipType_Name, mshipstatustypes.mshipStatusType_Name";
  sql += "," + "membertomships.memberToMship_EndDate";
  sql += " "+"FROM members LEFT JOIN membertomships ON membertomships.member_Id = members.member_Id";
  sql += " "+"LEFT JOIN mshipstatustypes ON mshipstatustypes.mshipStatusType_Id = membertomships.mshipStatusType_Id";
  sql += " "+"LEFT JOIN mshipoptions ON mshipoptions.mshipOption_Id = membertomships.mshipOption_Id";
  sql += " "+"LEFT JOIN mshiptypes ON mshiptypes.mshipType_Id = mshipoptions.mshipType_Id";
  sql += " " + "WHERE membertomships.memberToMship_PayMethod='Cash' AND  mshipstatustypes.mshipStatusType_Name='Live' AND  mshipstatustypes.mshipStatusType_Name = 'Defaulter'  AND mshipstatustypes.mshipStatusType_Name='Frozen'"
  • 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-23T17:12:47+00:00Added an answer on May 23, 2026 at 5:12 pm

    if spelling of the column is right then i think compiler dont identified that the column belongs to which table as column appears in multiple tables so try to use table name before column like

    mshiptypes.mshipType_Name
    

    There is no possibility that there is two values in mshipStatusType_Name at a time you use OR
    instead of And Like this:

    mshipStatusType_Name='value1' or mshipStatusType_Name='value2' ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying to get the unique values in each column of a
I'm trying get values from a GridView using the following code: foreach (GridViewRow row
Trying to get an ASP application deployed; it worked for a while but then
I'm trying to duplicate a particular entry in the form. I get all the
I have a database where I am trying to group together similar column values
I am trying to get a drop-down list to display column data containing countries
I'm trying to pass two variables (a search query (String) and a column name
I have the following code, I'm trying to get a table with 4 columns
Trying to get my css / C# functions to look like this: body {
Trying to get this example working from http://www.munna.shatkotha.com/blog/post/2008/10/26/Light-box-effect-with-WPF.aspx However, I can't seem to get

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.