Home > database >  How to do this select query statistics statements
How to do this select query statistics statements

Time:09-15




Two table data

If the date of implementation in the table below statement, which prawn to give answers to

CodePudding user response:

Select * from table 1 a, table 2 b where a. title=b. title and a. time='20191211'

CodePudding user response:

The total number of lending table?

CodePudding user response:

refer to the second floor lnxugy response:
total number of lending table?

Select *, total lending=(select sum (lend) from table 1 where a. title=title and time=a. time) from table 1 a, 2 b where a. title=b. title and a. time='20191211'

CodePudding user response:



Table structure I give out, didn't understand you write, I two behind the original table and other fields

CodePudding user response:

The select a.n ame, a. ookname, a.s huliang, a.t ime, a. ack, b.k c, jc_count=(select sum (shuliang) from memo where bookname=a. ookname and back='n') from memo. A, b kuchun order by a.t ime, a.n ame, a. ookname

CodePudding user response:

You taking inventory condition, this is a query on a daily basis the query will add inventory table, I think you should is to want to look at this point the lock time query the corresponding inventory, at the table structure do you now, check a previous time will be slow

CodePudding user response:

Take a look at several classic SQL query, enough you lifetime

CodePudding user response:

The SELECT A.N AME,
A. OOKNAME,
A.S HULIANG,
A.T IME,
A. an ACK,
B.K C,
JC_COUNT=(SELECT SUM (SHULIANG)
The FROM MEMO
WHERE BOOKNAME=a. OOKNAME
AND the BACK='no')
The FROM MEMO A, KUCHUN B
WHERE a. OOKNAME=B.B OOKNAME
AND A.T IME=TO_DATE (' 20191211 ', 'YYYYMMDD')
The ORDER BY A.T IME, A.N AME, a. OOKNAME
  • Related