A
A
Asya2016-07-02 15:45:07
MySQL
Asya, 2016-07-02 15:45:07

How to match sql columns?

How to match this column

SELECT distinct col1+col2 as sum
FROM table1 
where col1>0
order by sum

with these
SELECT *
FROM table1

?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Golubkov, 2016-07-02
@Android97

If the tables are related, then you can try JOIN (INNER, LEFT, RIGHT).

V
Vitaly, 2016-07-02
@vshvydky

string CONCAT(str1 string, str2 string,...)
Concatenates strings The result is a string of arguments. Returns NULL if any of the arguments is NULL. There can be more than 2 arguments. Numeric arguments are converted to the appropriate strings.
Examples:
mysql> select CONCAT('My', 'S', 'QL');
-> 'MySQL'
mysql> select CONCAT('My', NULL, 'QL');
-> NULL
mysql> select CONCAT(14.3);
-> '14.3'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question