W
W
w_b_x2016-02-03 18:55:07
MySQL
w_b_x, 2016-02-03 18:55:07

How to combine 2 SQL queries into 1?

There are 4 MYSQL queries, I will give an example of two, I think by analogy I will do with 4.

SELECT COUNT( `id` ) AS `lll` FROM `link_base` WHERE `create_date` = CURDATE()
SELECT COUNT( `id` ) AS `aaa` FROM `ad_base` WHERE `create_date` = CURDATE()

How to combine them into 1 request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Immortal_pony, 2016-02-03
@w_b_x

SELECT
    (SELECT COUNT( `id` ) FROM `link_base` WHERE `create_date` = CURDATE()) AS `lll` 
    (SELECT COUNT( `id` ) FROM `ad_base` WHERE `create_date` = CURDATE()) AS `aaa`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question