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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:57:55+00:00 2026-06-17T12:57:55+00:00

This problem is eating up my brain for the past few hours. I have

  • 0

This problem is eating up my brain for the past few hours.

I have 2 tables:

**domain_pricing**
action  enum()
map varchar(10)
cost_price  varchar(10)
sale_price  varchar(10) 

**domain_mapping**
map varchar(10)
tld varchar(10)

map is common for both tables.
sample data:

**domain_pricing**
addnewdomain,dotbiz,12,13
renewdomain,dotbiz,12,13
transferdomain,dotbiz,12,13

**domain_mapping**
dotbiz,biz
dotbiz,fizz
dotbiz,jizz

what i need after join:

biz,addnewdomain,12,13
biz,renewdomain,12,13
biz,transferdomain,12,13
fizz,addnewdomain,12,13
fizz,renewdomain,12,13
fizz,transferdomain,12,13
jizz,addnewdomain,12,13
jizz,renewdomain,12,13
jizz,transferdomain,12,13

my query:

select m.tld,p.action,p.sales_price,p.cost_price from domain_pricing as p, domain_mapping as m where p.map=m.map

result:
biz,addnewdomain,12,13
biz,renewdomain,12,13
biz,transferdomain,12,13
dats all, tried doing left join but that gave all values for biz then fizz,null,null and finally jizz,null,null

Can’t figure out where i’m going wrong

  • 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-17T12:57:56+00:00Added an answer on June 17, 2026 at 12:57 pm

    I think solved your problem. And the best part is that there is nothing wrong with your query. 😉 You only made a typo in you query. That happens to everybody.

    select m.tld,p.action,p.sale*s*_price,p.cost_price from domain_pricing as p, domain_mapping as m where p.map=m.map

    It should be:

    select m.tld,p.action,p.sale_price,p.cost_price from domain_pricing as p, domain_mapping as m where p.map=m.map
    

    The difference is that you query looks for the non existing column sale*s*. The column you want is sale.

        CREATE TABLE domain_pricing (
      action enum('addnewdomain','renewdomain','transferdomain')  primary key,
      map varchar(10),
      cost_price  varchar(10),
      sale_price  varchar(10)
      );
    
    CREATE TABLE domain_mapping(
      map varchar(10),
      tld varchar(10)
      );
    
    INSERT INTO domain_pricing (action, map, cost_price, sale_price)
    VALUES 
    ('addnewdomain','dotbiz',12,13),
    ('renewdomain','dotbiz',12,13),
    ('transferdomain','dotbiz',12,13);
    
    INSERT INTO domain_mapping (map,tld)
    VALUES 
    ('dotbiz','biz'),
    ('dotbiz','fizz'),
    ('dotbiz','jizz');
    
    SELECT * FROM domain_pricing;
    
    SELECT * FROM domain_mapping;
    
    select m.tld,p.action,p.sale_price,p.cost_price from domain_pricing as p, domain_mapping as m where p.map=m.map;
    
    
    select m.tld,p.action,p.cost_price, p.sale_price, from domain_pricing as p, domain_mapping as m where p.map=m.map;
    

    See it in action: http://www.sqlfiddle.com/#!2/f6b83/7

    B.T.W. I’m not sure why you would need enum for action? I would suggest to use an integer column for the primary key instead.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem has bugged me so many times and i have now decided to
This is a problem that has been eating at me for a while, and
So I'm having this strange problem. I have a ribbon moving behind the navigation
This problem is same as asked in here . Given a list of coins,
This problem seems very simple to me, but I've been unable to fix it,
This problem is caused by my acknowledge of English and jQuery or maybe something
This problem has been bugging me for a long time. For example, the code
This problem is about concurrent high speed inserts. I must admit it is very
This problem is very strange and I'm hoping someone can help me. For the
This problem is happening for me on IE8 and Chrome which makes me think

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.