.


:




:

































 

 

 

 





 

- , WHERE (HAVING) SELECT. WHERE (HAVING) ..

:

1) 20202840600000000000.

 

. :

1) ;

2) .

 

. :

 

Select max(op.OperDate)

From tResource r

,tOperPart op

Where r.Brief = '20202840600000000000'

and op.ResourceID = r.ResourceID

 

:

Select op.*

From tResource r

,tOperPart op

Where r.Brief = '20202840600000000000'

and op.ResourceID = r.ResourceID

and op.Operdate =

 

:

 

Select op.*

From tResource r

,tOperPart op

Where r.Brief = '20202840600000000000'

and op.ResourceID = r.ResourceID

and op.Operdate = (Select max(op.OperDate)

From tResource r

,tOperPart op

Where r.Brief = '20202840600000000000'

and op.ResourceID = r.ResourceID)

 

:

 

1)

, , , TRUE. , . (=, <>, <, <=, >, >=), . , , , , . , . NULL, NULL.

 

2)

( IN) . , , , TRUE. , , . NOT IN .

ANY. :

 

Select *

From table1

Where b = ANY (select b

from table 2)

ANY , , , b .

, , ANY ALL.

 

3)

( EXISTS) , . . , "SELECT * FROM..." , .. - , FROM , WHERE . , , NOT EXISTS. . :

 

Select *

From table1

Where EXISTS (select *

from table 2

where table1.a = table2.c)

 





:


: 2016-11-03; !; : 363 |


:

:

, .
==> ...

1879 - | 1694 -


© 2015-2024 lektsii.org - -

: 0.01 .