How do I Combine these SQL SELECT queries into one SELECT statement

前端 未结 5 1785
挽巷
挽巷 2021-01-17 22:17

How do I combine these two select statements into one query:

SELECT SUM( incidents )  AS fires, neighborhoods AS fire_neighborhoods
FROM (
SELECT * 
FROM `fi         


        
5条回答
  •  甜味超标
    2021-01-17 23:05

    Displaying two unrelated queries side-by-side is usually the job of the reporting software rather than the SQL engine. The problem here is that you are asking the query tool to do something that it is not suited to do: display formatting.

    A relation (which is what the result of a SELECT is supposed to be, fundamentally) is a data structure that makes assertions about the state of the world. Each row defines a series of propositions which are (ideally) true.

    In your question, the rows contain arbitrary concatinations of facts which do not relate to one another and about which no propositions can be stated.

提交回复
热议问题