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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:58:56+00:00 2026-06-11T14:58:56+00:00

Say I have an Encoding table that containing various types, for ex: ID EncodingName

  • 0

Say I have an Encoding table that containing various types, for ex:

    ID  EncodingName
    ------------------
    1   UTF-8
    2   ISO-8859-1

And another EncodingMapping that uses these IDs to keep track of which encodings to convert From and To:

    ID  ItemId_FK  EncodingFromId_FK  EncodingToId_FK
    -------------------------------------------------
    1   45         2                  1  
    2   78         1                  2

I want to create an SQL statement that creates the following result when ItemId_FK = 45 (for example):

   FromEncoding  ToEncoding
   -------------------------
   ISO-8859-1    UTF-8

Seems like it would be simple enough, but I cannot a get a JOIN to work by returning a single row in this format.

What I have so far (THIS IS WRONG):

   SELECT EncodingName As FromEncoding, EncodingName As ToEncoding
   FROM Encoding
   LEFT JOIN EncodingMapping As em
   ON Encoding.ID = em.EncodingFromId_FK OR Encoding.ID = em.EncodingToId_FK
   WHERE ItemId_FK = 45
  • 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-11T14:58:58+00:00Added an answer on June 11, 2026 at 2:58 pm

    Close, but not cigar:

    SELECT 
      FromEnc.EncodingName AS FromEncoding, 
      ToEnc.EncodingName AS ToEncoding
    FROM EncodingMapping
    INNER JOIN Encoding AS FromEnc
      ON FromEnc.ID=EncodingMapping.EncodingFromId_FK
    INNER JOIN Encoding AS ToEnc
      ON ToEnc.ID=EncodingMapping.EncodingToId_FK
    WHERE EncodingMapping.ItemId_FK = 45
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a SSI script that uses exec, or a PHP script that
For example, say I have the following xml in a string: <?xml version=1.0 encoding=UTF-8?>
Lets say I have a string: char theString[] = 你们好āa; Given that my encoding
Say, I have a sub that receives two arguments: An encoding specification, and a
Say I have three tables, a table of users, a table of around 500
i have a table that have one column (AbsoluteUrl NVARCHAR(2048)) and i want to
Lets say we have this code that runs in the constructor: Dim initVectorBytes As
Let's say I have an HTML page with a text field that ask the
If I have an AJAX call that returns, say, a CSV, how do I
I am quite new to utf-8 encoding and have used htmlentities() ever since, but

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.