Sei sulla pagina 1di 7
Giinseed Comparison operators are used to compare one expression with another. In this topic, you will learn about the comparison opetaters that ara used ina singlo-row cubquey. Gonos xi ‘A single-rew subquery retums onlyane value from a table. Youcan compare the value retumed by a single-row subquery| with the value considered ay he outer query by using camparisen operators. A lst of the commperisan operatars wih theirmearings is displayed along with examples of haw they are used. Cone ear Saee AIP eee 2 Ss F "Youlearnedabeue meaning ante usec sageaw Ceraran persone You wiluse em fe SELECT SML> SELECT enane, empno, deptno, 521 2 5 ‘ FRO emp WHERE Sel co (SELECT sat Fnow enp. WERE enane ~ “KING*) ‘he gle subquer eum HNC sala i compieted ‘arouses qty wuld ease an norte 2 rmotahar on erploae calle NG neon abe Because her his sngle-ow susquer lem maethae [SAL SELECT enane, empno, deptno, sat FRO emp WHERE Sel co (SELECT sat Fnow enp. WERE’ enane ~ “KING") AHO deptno = (SELECT deptno HOM enp. WERE epne = 799) exeMo DEPTH. wn Sa he seen aspajs he empleee names, ries rurers an ceparmertrurber ofthe oploees whose Alepattnentnumbors aretha care asthe forporee humier 7934, butwiase aes a7 lesan or equals Emit You can use graup functions in subqueries to operate on a group cfvalues and display one resultfor every group. For example, oroup functions tan be usedto caleulate the average, the manimurn, the minimum ane the sum af a goup of numeric values.

Potrebbero piacerti anche