Combine irrelevant columns from two tables in Mysql
up vote
-1
down vote
favorite
I just want to compare two results from SELECT Query. so how to combine columns from two tables without any relevance(nothing could be same, so can't use JOIN.. ON.. query).
And here is my Query Code:
SELECT QueryName,Recommendation,Price
FROM PaidGame
WHERE PriceFinal != '0';
SELECT QueryName,Recommendation,Price
FROM FreeGame
WHERE PriceFinal = '0';
My question is, is there any possible way for me to combine these columns in one output.
Here is my output, I want to get these 6 columns together, just for comparison.
enter image description here
enter image description here
And here is what I expected, I just want to make them show together.
enter image description here
mysql
|
show 2 more comments
up vote
-1
down vote
favorite
I just want to compare two results from SELECT Query. so how to combine columns from two tables without any relevance(nothing could be same, so can't use JOIN.. ON.. query).
And here is my Query Code:
SELECT QueryName,Recommendation,Price
FROM PaidGame
WHERE PriceFinal != '0';
SELECT QueryName,Recommendation,Price
FROM FreeGame
WHERE PriceFinal = '0';
My question is, is there any possible way for me to combine these columns in one output.
Here is my output, I want to get these 6 columns together, just for comparison.
enter image description here
enter image description here
And here is what I expected, I just want to make them show together.
enter image description here
mysql
more details, I want to see 6 columns for the up question. not just 3
– Jiacheng Gao
Nov 9 at 0:16
Please provide a short example of input and expected output.
– Henning Koehler
Nov 9 at 0:17
Learn how to ask question here. stackoverflow.com/help/how-to-ask
– Eric
Nov 9 at 0:18
sorry about the fewer details about output, and expected output, I just add the screenshot for the output
– Jiacheng Gao
Nov 9 at 1:13
Your question says there are no similar columns, yet the output image shows that QueryName is the same. Why not join on that?
– Sam M
Nov 9 at 2:38
|
show 2 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I just want to compare two results from SELECT Query. so how to combine columns from two tables without any relevance(nothing could be same, so can't use JOIN.. ON.. query).
And here is my Query Code:
SELECT QueryName,Recommendation,Price
FROM PaidGame
WHERE PriceFinal != '0';
SELECT QueryName,Recommendation,Price
FROM FreeGame
WHERE PriceFinal = '0';
My question is, is there any possible way for me to combine these columns in one output.
Here is my output, I want to get these 6 columns together, just for comparison.
enter image description here
enter image description here
And here is what I expected, I just want to make them show together.
enter image description here
mysql
I just want to compare two results from SELECT Query. so how to combine columns from two tables without any relevance(nothing could be same, so can't use JOIN.. ON.. query).
And here is my Query Code:
SELECT QueryName,Recommendation,Price
FROM PaidGame
WHERE PriceFinal != '0';
SELECT QueryName,Recommendation,Price
FROM FreeGame
WHERE PriceFinal = '0';
My question is, is there any possible way for me to combine these columns in one output.
Here is my output, I want to get these 6 columns together, just for comparison.
enter image description here
enter image description here
And here is what I expected, I just want to make them show together.
enter image description here
mysql
mysql
edited Nov 9 at 2:12
asked Nov 9 at 0:14
Jiacheng Gao
33
33
more details, I want to see 6 columns for the up question. not just 3
– Jiacheng Gao
Nov 9 at 0:16
Please provide a short example of input and expected output.
– Henning Koehler
Nov 9 at 0:17
Learn how to ask question here. stackoverflow.com/help/how-to-ask
– Eric
Nov 9 at 0:18
sorry about the fewer details about output, and expected output, I just add the screenshot for the output
– Jiacheng Gao
Nov 9 at 1:13
Your question says there are no similar columns, yet the output image shows that QueryName is the same. Why not join on that?
– Sam M
Nov 9 at 2:38
|
show 2 more comments
more details, I want to see 6 columns for the up question. not just 3
– Jiacheng Gao
Nov 9 at 0:16
Please provide a short example of input and expected output.
– Henning Koehler
Nov 9 at 0:17
Learn how to ask question here. stackoverflow.com/help/how-to-ask
– Eric
Nov 9 at 0:18
sorry about the fewer details about output, and expected output, I just add the screenshot for the output
– Jiacheng Gao
Nov 9 at 1:13
Your question says there are no similar columns, yet the output image shows that QueryName is the same. Why not join on that?
– Sam M
Nov 9 at 2:38
more details, I want to see 6 columns for the up question. not just 3
– Jiacheng Gao
Nov 9 at 0:16
more details, I want to see 6 columns for the up question. not just 3
– Jiacheng Gao
Nov 9 at 0:16
Please provide a short example of input and expected output.
– Henning Koehler
Nov 9 at 0:17
Please provide a short example of input and expected output.
– Henning Koehler
Nov 9 at 0:17
Learn how to ask question here. stackoverflow.com/help/how-to-ask
– Eric
Nov 9 at 0:18
Learn how to ask question here. stackoverflow.com/help/how-to-ask
– Eric
Nov 9 at 0:18
sorry about the fewer details about output, and expected output, I just add the screenshot for the output
– Jiacheng Gao
Nov 9 at 1:13
sorry about the fewer details about output, and expected output, I just add the screenshot for the output
– Jiacheng Gao
Nov 9 at 1:13
Your question says there are no similar columns, yet the output image shows that QueryName is the same. Why not join on that?
– Sam M
Nov 9 at 2:38
Your question says there are no similar columns, yet the output image shows that QueryName is the same. Why not join on that?
– Sam M
Nov 9 at 2:38
|
show 2 more comments
3 Answers
3
active
oldest
votes
up vote
0
down vote
accepted
SELECT QueryName,Recommendation,Price FROM PaidGame WHERE PriceFinal != '0'
UNION ALL
SELECT QueryName,Recommendation,Price FROM FreeGame WHERE PriceFinal = '0';
This is what you are after. The keyword ALL may not be necessary.
More examples: https://www.w3schools.com/sql/sql_union.asp
Updated
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P, FreeGame F
Or
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P
JOIN FreeGame F
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern ExplicitJoinbased syntax
– Madhur Bhaiya
Nov 9 at 9:54
1
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
add a comment |
up vote
0
down vote
You could do a union or union all to combine the two selects or compare the checksum of the 3 columns to see if they are equal
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
add a comment |
up vote
0
down vote
Aside from the issue that this would be better done in the presentation layer (e.g. XSL, report etc), you can do it.
My solution would be to create an index table, then join to each of the table querie,s adding in a row identifier. Something like this (hopefully this translates to Mysql - I'm more of a TSQL person):
create table #index (indexnum int)
declare @minnum as int set @minnum=1 while @minnum<1000 BEGIN
insert into #index select @minnum set @minnum=@minnum+1 END
create table #paidgame (queryname varchar(100), recommendation varchar(100), price varchar (100))
create table #freegame (queryname varchar(100), recommendation varchar(100), price varchar (100))
insert into #paidgame select 'Game 1', 'Good', '£4.99' UNION ALL select 'Game 2', 'Good', '£3.99' UNION ALL select 'Game 3', 'Good', '£5.99'
insert into #freegame select 'Game 4', 'Good', '£0.00' UNION ALL select 'Game 5', 'Good', '£0.00' UNION ALL select 'Game 6', 'Good', '£0.00'
select * from
#index i left join (select * from (
SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as prank FROM #PaidGame pg ) aa ) t1 on t1.prank=i.indexnumn
left join
(select * from (SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as frank FROM #FreeGame fg ) bb) t2 on i.indexnumn=t2.frank
where t1.queryname is not null and t2.queryname is not null
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
SELECT QueryName,Recommendation,Price FROM PaidGame WHERE PriceFinal != '0'
UNION ALL
SELECT QueryName,Recommendation,Price FROM FreeGame WHERE PriceFinal = '0';
This is what you are after. The keyword ALL may not be necessary.
More examples: https://www.w3schools.com/sql/sql_union.asp
Updated
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P, FreeGame F
Or
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P
JOIN FreeGame F
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern ExplicitJoinbased syntax
– Madhur Bhaiya
Nov 9 at 9:54
1
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
add a comment |
up vote
0
down vote
accepted
SELECT QueryName,Recommendation,Price FROM PaidGame WHERE PriceFinal != '0'
UNION ALL
SELECT QueryName,Recommendation,Price FROM FreeGame WHERE PriceFinal = '0';
This is what you are after. The keyword ALL may not be necessary.
More examples: https://www.w3schools.com/sql/sql_union.asp
Updated
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P, FreeGame F
Or
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P
JOIN FreeGame F
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern ExplicitJoinbased syntax
– Madhur Bhaiya
Nov 9 at 9:54
1
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
SELECT QueryName,Recommendation,Price FROM PaidGame WHERE PriceFinal != '0'
UNION ALL
SELECT QueryName,Recommendation,Price FROM FreeGame WHERE PriceFinal = '0';
This is what you are after. The keyword ALL may not be necessary.
More examples: https://www.w3schools.com/sql/sql_union.asp
Updated
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P, FreeGame F
Or
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P
JOIN FreeGame F
SELECT QueryName,Recommendation,Price FROM PaidGame WHERE PriceFinal != '0'
UNION ALL
SELECT QueryName,Recommendation,Price FROM FreeGame WHERE PriceFinal = '0';
This is what you are after. The keyword ALL may not be necessary.
More examples: https://www.w3schools.com/sql/sql_union.asp
Updated
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P, FreeGame F
Or
SELECT P.QueryName, P.Recommendation, P.Price, F.QueryName, F.Recommendation, F.Price
FROM PaidGame P
JOIN FreeGame F
edited Nov 9 at 14:29
answered Nov 9 at 1:35
Mohammad C
1,1281212
1,1281212
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern ExplicitJoinbased syntax
– Madhur Bhaiya
Nov 9 at 9:54
1
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
add a comment |
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern ExplicitJoinbased syntax
– Madhur Bhaiya
Nov 9 at 9:54
1
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
yes, you are right, but I don't want to combine these 6 columns to 3, I just want to see 6 columns, just like columns: QueryName, Recommendation, Price, QueryName, Recommendation, Price
– Jiacheng Gao
Nov 9 at 2:08
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Check the updated. This will show all combinations so u will have repetitions coz they don't have anything in common. Also is the where conditions needed. Free games are always 0 and Paid games are never 0. Right?
– Mohammad C
Nov 9 at 9:50
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern Explicit
Join based syntax– Madhur Bhaiya
Nov 9 at 9:54
Your edited answer wont work. It is a poor Cross JOIN and will give out 36 rows, if there are 6 rows only in both the tables. Also, Please don't use Old comma based Implicit joins and use Modern Explicit
Join based syntax– Madhur Bhaiya
Nov 9 at 9:54
1
1
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
what you updated works for me, thanks a lot, sorry for the late reply
– Jiacheng Gao
Nov 12 at 17:05
add a comment |
up vote
0
down vote
You could do a union or union all to combine the two selects or compare the checksum of the 3 columns to see if they are equal
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
add a comment |
up vote
0
down vote
You could do a union or union all to combine the two selects or compare the checksum of the 3 columns to see if they are equal
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
add a comment |
up vote
0
down vote
up vote
0
down vote
You could do a union or union all to combine the two selects or compare the checksum of the 3 columns to see if they are equal
You could do a union or union all to combine the two selects or compare the checksum of the 3 columns to see if they are equal
answered Nov 9 at 1:28
Jassem Abdal
1
1
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
add a comment |
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
thanks, I understand, but I just want to make them show together, I changed my question, you could see what I expected, 6 columns.
– Jiacheng Gao
Nov 9 at 2:14
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
You could do row_number() on each table into temp tables then join or outer join the two tables based on the row number
– Jassem Abdal
Nov 10 at 13:10
add a comment |
up vote
0
down vote
Aside from the issue that this would be better done in the presentation layer (e.g. XSL, report etc), you can do it.
My solution would be to create an index table, then join to each of the table querie,s adding in a row identifier. Something like this (hopefully this translates to Mysql - I'm more of a TSQL person):
create table #index (indexnum int)
declare @minnum as int set @minnum=1 while @minnum<1000 BEGIN
insert into #index select @minnum set @minnum=@minnum+1 END
create table #paidgame (queryname varchar(100), recommendation varchar(100), price varchar (100))
create table #freegame (queryname varchar(100), recommendation varchar(100), price varchar (100))
insert into #paidgame select 'Game 1', 'Good', '£4.99' UNION ALL select 'Game 2', 'Good', '£3.99' UNION ALL select 'Game 3', 'Good', '£5.99'
insert into #freegame select 'Game 4', 'Good', '£0.00' UNION ALL select 'Game 5', 'Good', '£0.00' UNION ALL select 'Game 6', 'Good', '£0.00'
select * from
#index i left join (select * from (
SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as prank FROM #PaidGame pg ) aa ) t1 on t1.prank=i.indexnumn
left join
(select * from (SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as frank FROM #FreeGame fg ) bb) t2 on i.indexnumn=t2.frank
where t1.queryname is not null and t2.queryname is not null
add a comment |
up vote
0
down vote
Aside from the issue that this would be better done in the presentation layer (e.g. XSL, report etc), you can do it.
My solution would be to create an index table, then join to each of the table querie,s adding in a row identifier. Something like this (hopefully this translates to Mysql - I'm more of a TSQL person):
create table #index (indexnum int)
declare @minnum as int set @minnum=1 while @minnum<1000 BEGIN
insert into #index select @minnum set @minnum=@minnum+1 END
create table #paidgame (queryname varchar(100), recommendation varchar(100), price varchar (100))
create table #freegame (queryname varchar(100), recommendation varchar(100), price varchar (100))
insert into #paidgame select 'Game 1', 'Good', '£4.99' UNION ALL select 'Game 2', 'Good', '£3.99' UNION ALL select 'Game 3', 'Good', '£5.99'
insert into #freegame select 'Game 4', 'Good', '£0.00' UNION ALL select 'Game 5', 'Good', '£0.00' UNION ALL select 'Game 6', 'Good', '£0.00'
select * from
#index i left join (select * from (
SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as prank FROM #PaidGame pg ) aa ) t1 on t1.prank=i.indexnumn
left join
(select * from (SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as frank FROM #FreeGame fg ) bb) t2 on i.indexnumn=t2.frank
where t1.queryname is not null and t2.queryname is not null
add a comment |
up vote
0
down vote
up vote
0
down vote
Aside from the issue that this would be better done in the presentation layer (e.g. XSL, report etc), you can do it.
My solution would be to create an index table, then join to each of the table querie,s adding in a row identifier. Something like this (hopefully this translates to Mysql - I'm more of a TSQL person):
create table #index (indexnum int)
declare @minnum as int set @minnum=1 while @minnum<1000 BEGIN
insert into #index select @minnum set @minnum=@minnum+1 END
create table #paidgame (queryname varchar(100), recommendation varchar(100), price varchar (100))
create table #freegame (queryname varchar(100), recommendation varchar(100), price varchar (100))
insert into #paidgame select 'Game 1', 'Good', '£4.99' UNION ALL select 'Game 2', 'Good', '£3.99' UNION ALL select 'Game 3', 'Good', '£5.99'
insert into #freegame select 'Game 4', 'Good', '£0.00' UNION ALL select 'Game 5', 'Good', '£0.00' UNION ALL select 'Game 6', 'Good', '£0.00'
select * from
#index i left join (select * from (
SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as prank FROM #PaidGame pg ) aa ) t1 on t1.prank=i.indexnumn
left join
(select * from (SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as frank FROM #FreeGame fg ) bb) t2 on i.indexnumn=t2.frank
where t1.queryname is not null and t2.queryname is not null
Aside from the issue that this would be better done in the presentation layer (e.g. XSL, report etc), you can do it.
My solution would be to create an index table, then join to each of the table querie,s adding in a row identifier. Something like this (hopefully this translates to Mysql - I'm more of a TSQL person):
create table #index (indexnum int)
declare @minnum as int set @minnum=1 while @minnum<1000 BEGIN
insert into #index select @minnum set @minnum=@minnum+1 END
create table #paidgame (queryname varchar(100), recommendation varchar(100), price varchar (100))
create table #freegame (queryname varchar(100), recommendation varchar(100), price varchar (100))
insert into #paidgame select 'Game 1', 'Good', '£4.99' UNION ALL select 'Game 2', 'Good', '£3.99' UNION ALL select 'Game 3', 'Good', '£5.99'
insert into #freegame select 'Game 4', 'Good', '£0.00' UNION ALL select 'Game 5', 'Good', '£0.00' UNION ALL select 'Game 6', 'Good', '£0.00'
select * from
#index i left join (select * from (
SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as prank FROM #PaidGame pg ) aa ) t1 on t1.prank=i.indexnumn
left join
(select * from (SELECT QueryName,Recommendation,Price, dense_rank() OVER (ORDER BY queryname) as frank FROM #FreeGame fg ) bb) t2 on i.indexnumn=t2.frank
where t1.queryname is not null and t2.queryname is not null
answered Nov 9 at 14:06
iainc
336
336
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53218049%2fcombine-irrelevant-columns-from-two-tables-in-mysql%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
more details, I want to see 6 columns for the up question. not just 3
– Jiacheng Gao
Nov 9 at 0:16
Please provide a short example of input and expected output.
– Henning Koehler
Nov 9 at 0:17
Learn how to ask question here. stackoverflow.com/help/how-to-ask
– Eric
Nov 9 at 0:18
sorry about the fewer details about output, and expected output, I just add the screenshot for the output
– Jiacheng Gao
Nov 9 at 1:13
Your question says there are no similar columns, yet the output image shows that QueryName is the same. Why not join on that?
– Sam M
Nov 9 at 2:38