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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:33:19+00:00 2026-06-06T02:33:19+00:00

I have the query to select some columns from two tables, which must contain

  • 0

I have the query to select some columns from two tables, which must contain some cells which are actually empty but have to name it in query such as

select name, REPLACE(format, ' – ', '/') as format, CAST(price AS UNSIGNED INTEGER) as price, CONCAT('http://example.com/',url_key) as url, level_id_value, delivery, sku from t1 where delivery <> 'slut' INTO OUTFILE 'test.txt' FIELDS TERMINATED BY '\t';

which perfectly works producing 2.5 MB size text file in lib folder but the other code as follows for another query where i have to add one column from another table along with some empty columns with some title, seems to work but produces a file size of around 11GB,

sELECT t1.sku, t.name, ' ' as Size, format, ' ' as subcategory, CAST(t1.price AS UNSIGNED INTEGER) as price, ' ' as dummy, CONCAT('http://example.com/',t1.url_key) as url, CONCAT('Från ',t1.level_id_value) as shipping_fee, t2.is_in_stock as stock, ' ' as text1, ' ' as Description from t2,t1 where t1.delivery <> 'slut' INTO OUTFILE 'test.txt' FIELDS TERMINATED BY '\t';

any help to debug this issue would be appreciable, don know much about mysql, so detailed explanation are highly welcome. Is there a way where i can make the code analogous to the first working code from two tables? I just need one column from t2 table, that is is_in_stock.

  • 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-06T02:33:22+00:00Added an answer on June 6, 2026 at 2:33 am

    So the first one is a simple query SELECT INTO with a WHERE clause, this is going to return a small number of results.

    The second one is showing an implicit inner join, but you arent returning the values based on a unique row, you just pull in everything from both tables, regardless of whether they are matching in both tables

    SELECT t1.sku, 
    t.name, 
    ' ' as Size, 
    format,
    ' ' as subcategory, CAST(t1.price AS UNSIGNED INTEGER) as price, 
    ' ' as dummy, CONCAT('http://example.com/',t1.url_key) as url, 
    CONCAT('Från ',t1.level_id_value) as shipping_fee, 
    t2.is_in_stock as stock, 
    ' ' as text1,
    ' ' as Description **`from t2,t1`** 
    where t1.delivery <> 'slut' INTO OUTFILE 'test.txt' FIELDS TERMINATED BY '\t';
    

    This one is how I would do it, but you still need to isolate each record, so what makes each row unique, and do the inner join ON those fields between t1 and t2 like inner join t2 ON t1.name = t2.name and t1.id = t2.id but it should look something like this

    SELECT t1.sku, 
    t1.name, 
    t1.format, 
    CAST(t1.price AS UNSIGNED INTEGER) as price, 
    CONCAT('http://example.com/',t1.url_key) as url,
    CONCAT('Från ',t1.level_id_value) as shipping_fee, 
    '' as dummy,
    '' as size, 
    '' as subcat,
    '' as text1,
    '' as Description,
    t2.is_in_stock as stock,
    from t1
    INNER JOIN t2 WHERE t1.delivery <> 'slut'
    INTO OUTFILE 'test.txt' FIELDS TERMINATED BY 't\';
    

    Hope it helps!

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

Sidebar

Related Questions

I have a query which will return some ids. SELECT ID FROM xf_menu WHERE
I have this query (which I removed some keys from for brevity's sake): SELECT
I've two tables which have following columns: Now I want have a SQL query
I have two tables with some ID's and I need a query that returns
What I have is a mySQL query that will select some drinks and return
I have the following MySQL query: SELECT title, description FROM some_table WHERE MATCH (title,description)
I have table tree. I have query: SELECT * FROM tree WHERE pid =10
We have the query: SELECT ID, MIN(SQRT(POW((100-x),2)) + POW((150-y),2)) AS distance FROM cabstands GROUP
I have a query select ... from x join y on .. where ...
I have two tables A and B, with dynamic columns where I have no

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.