1.(SELECT...)
2.can use with SELECT,FROM,WHERE,HAVING
EX1
SELECT CustTable.CustID, CustTable.balance, (
SELECT SUM( CustTable.balance )
FROM CustTable
), CustTable.balance / ( FROM CustTable
SELECT SUM( CustTable.balance )
FROM CustTable ) *100
FROM `custtable`
EX2
SELECT * FROM CustTable WHERE CustTable.Balance >= ( SELECT avg(CustTable.Balance) FROM CustTable );
EX3 SELECT iCityID, sCityName FROM citymaster c where iCityID in(SELECT iStateID FROM statemaster s)