Feature Request: Allow 2 query tabs on 1 screen

[expired user #9801]'s profile image [expired user #9801] posted 8 years ago in General Permalink

Something like this maybe?

[expired user #9801]'s profile image [expired user #9801] posted 8 years ago Permalink

I find this very very useful

ansgar's profile image ansgar posted 8 years ago Permalink

What's a real word use case for having two queries besides each other?

[expired user #10016]'s profile image [expired user #10016] posted 8 years ago Permalink

First, a couple things to know about creating a union query:

The select queries you combine in a union query need to have the same number of output fields, in the same order, and with the same or compatible data types. When you run a union query, data from each set of corresponding fields is combined into one output field so that the query output has the same number of fields as each of the SELECT statements.

A union query is SQL-specific, and therefore must be written directly in SQL. You switch to SQL View to write SQL-specific queries, including union queries.

Check this website american-writers.org for writing help.

[expired user #9801]'s profile image [expired user #9801] posted 8 years ago Permalink

@ansgar I use this when I want to quickly compare data and queries. I don't want to keep switching tabs just to find a difference. At the moment I use notepad++ to compare queries. For comparing data I open 2 Heidisql screens and let windows put 1 on the left side and 1 on the right side. This take in a lot of room on my screen which is a 20 inch.

@tamarasherwood I don't understand why you posted this

[expired user #9801]'s profile image [expired user #9801] posted 8 years ago Permalink

An example:

I have a database with sales information.

Two guys come and buy three products. One guy says he paid 5 euro. The other one says he paid 6 euro. Both of them say they bought exactly the same product.

If you try executing this query:

select Person_id, Product_id, Product_name from Sales where Person_id = 1 or Person_id = 2;

Person_id  |  Product_id  |  Product_name
     1           100             cake
     1           101             candy
     1           102             cola
     2           100             cake
     2           101             candy
     2           103             pepsi

You would get 6 rows in one list. You can compare this but I don't find this as easy as doing the following:

tab1: select Person_id, Product_id, Product_name from Sales where Person_id = 1

tab2: select Person_id, Product_id, Product_name from Sales where Person_id = 1

Person_id  |  Product_id  |  Product_name     ||     Person_id  |  Product_id  |  Product_name
     1           100             cake         ||          2           100             cake
     1           101             candy        ||          2           101             candy
     1           102             cola         ||          2           103             pepsi
[expired user #9801]'s profile image [expired user #9801] posted 8 years ago Permalink

This way I can quickly figure out where and what is different

[expired user #9801]'s profile image [expired user #9801] posted 8 years ago Permalink

tab 2 should be tab2: select Person_id, Product_id, Product_name from Sales where Person_id = 2

[expired user #9801]'s profile image [expired user #9801] posted 8 years ago Permalink

Of course you could write a join query. But copying the same query is much faster than writing the join query.

Please login to leave a reply, or register at first.