Home > database >  This effect if the SQL prompt> ORA - 00936: lack expression mistake how to solve
This effect if the SQL prompt> ORA - 00936: lack expression mistake how to solve

Time:09-15

SELECT TO_CHAR (CJSJ, 'yyyy) as the sum (1) as the total, the COUNT (SELECT QLLX FROM BDC_DJSQB WHERE QLLX=' 1060040153 ') as buying and selling, the COUNT (SELECT QLLX FROM BDC_DJSQB WHERE QLLX='1060010177 _1060040164) as mortgage cancellation FROM ss_SQB t

Group by to_char (CJSJ, 'yyyy)
The ORDER BY the annual

Help to look at, I want this effect is
The annual total applications sell quantity mortgage cancellation application
2020 1000 500 300


This effect if the SQL prompt
ORA - 00936: lack expression mistake how to solve the

Consult everybody a great god

CodePudding user response:

COUNT (SELECT QLLX FROM BDC_DJSQB WHERE QLLX='1060040153') what is this query, what is the business logic, why to check?

The subquery in the column is called a scalar subquery, are not allowed to return to multi-line,
You can write
SELECT count (QLLX) FROM BDC_DJSQB WHERE QLLX='1060040153'
But do not know whether meet your business needs

CodePudding user response:

Is the example, the effect of the interview on three fields are statistical quantity

CodePudding user response:

reference 1st floor js14982 response:
COUNT (SELECT QLLX FROM BDC_DJSQB WHERE QLLX='1060040153') what is this query, what is the business logic, why to check?

The subquery in the column is called a scalar subquery, are not allowed to return to multi-line,
You can write
SELECT count (QLLX) FROM BDC_DJSQB WHERE QLLX='1060040153'
But don't know whether to meet your business requirements
is the demonstration effect, and then the number three fields represent the three statistical quantity

CodePudding user response:

Wrong, is a field, the field of the table is linked with another table is equal to the number is another form of buying and selling of what type

CodePudding user response:

You ss_SQB table and BDC_DJSQB table is associated by field match? These two tables have a relationship?

CodePudding user response:

reference 5 floor js14982 reply:
you ss_SQB table and BDC_DJSQB table is associated by field match? These two tables have a relationship?
this can be solved in case the when I have resolved the

CodePudding user response:

reference 5 floor js14982 reply:
you ss_SQB table and BDC_DJSQB table is associated by field match? These two tables have a relationship?
thank you

CodePudding user response:

reference 5 floor js14982 reply:
you ss_SQB table and BDC_DJSQB table is associated by field match? These two tables have a relationship?
on whether a field is equal to the condition judgment

CodePudding user response:

COUNT (SELECT QLLX FROM BDC_DJSQB WHERE QLLX='1060040153') as buying and selling,

Change

(SELECT count (QLLX) FROM BDC_DJSQB WHERE QLLX='1060040153') as buying and selling,
  • Related