Home > database >  The Oracle database query problem for solutions
The Oracle database query problem for solutions

Time:09-24

Recently met a question, answer


You see above, this is my query statement, the statement code doesn't arrange, make do with see, I am now the subquery and a query, the subquery can find in the data, that is, the value of the number1 is can query, but according to the query as shown, look up to the value is nothing, I also looked at the results of the query, the query result is not there, now I want to achieve, subqueries values can be displayed, namely number1 query the data by the subquery, another column values to 0 instead, excuse me this how?

CodePudding user response:

By connection on the left, the right connection

CodePudding user response:

reference 1st floor liuzhijian2008x response:
by connection on the left and the right connection

But different ah, before the subquery is a query date of record, and outside the query is a query within the specified range

CodePudding user response:

Sub queries have value, total value, where is your last surface conditions

CodePudding user response:

I see, you the subquery is before February 1, outside the where is 0 to 9 PM, that is to say you didn't have to data 0 to 9 PM

CodePudding user response:

reference baidu_36457652 reply: 3/f
sub queries have value, total value, where is your last surface conditions caused by

Right, is the question, but how to solve, I must show the value of the subquery where conditions must exist, but in the end face for the first query filtering, so how to realize the value of the subquery, but another look not to come out the value to 0 instead

CodePudding user response:

reference 4 floor baidu_36457652 response:
I see see, you the subquery is before February 1, outside the where is 0 to 9 PM, that is to say you 0 to 9 PM didn't get the data

Right, it is this meaning, I need the subquery query no. 2.1 before, but external query need query number 2.1 00:00 9 points assigned to the data, there is no data but external inquiry, the subquery is data, that how to show the subquery data, but the outside of the query data to 0 instead

CodePudding user response:

refer to 6th floor a136838143 response:
Quote: refer to 4th floor baidu_36457652 response:

I see, you the subquery is before February 1, outside the where is 0 to 9 PM, that is to say you 0 to 9 PM didn't get the data

Right, it is this meaning, I need the subquery query no. 2.1 before, but external query need query number 2.1 00:00 9 points assigned to the data, there is no data but external inquiry, the subquery is data, that how to show the subquery data, but the outside of the query data to 0 instead of

You can't use the subquery, table connection ways,

CodePudding user response:

refer to 7th floor baidu_36457652 response:
Quote: refer to the sixth floor a136838143 response:

Quote: refer to 4th floor baidu_36457652 response:

I see, you the subquery is before February 1, outside the where is 0 to 9 PM, that is to say you 0 to 9 PM didn't get the data

Right, it is this meaning, I need the subquery query no. 2.1 before, but external query need query number 2.1 00:00 9 points assigned to the data, there is no data but external inquiry, the subquery is data, that how to show the subquery data, but the outside of the query data to 0 instead of

You can't use the subquery, with table joins,

The table joins, different conditions how to write instead

CodePudding user response:

Such as you looked at the table a query, looked at the table don't subquery part b
And then a left join b on associated fields
  • Related