![]() Related Questions Can we use aggregate function in another aggregate functionsuppose we got count of a column by using Can we use aggregate function in another aggregate functionsuppose we got count of a column by using the group by clause so we get different counts in the same statement how to get the maximum of count Read Answers (11) | Asked by : sahithi Latest Answer : We cannot use a commit statement in a trigger. Trigger has auto commit. ... Read Answers (18) | Asked by : suresh In SQL. (DB2)there is one Dept table and other Emp tableQuestion- select Emp Name from Emp whose Dept No. is not in Dept table and it is present in Emp table Plz tell the Query? Read Answers (8) | Asked by : dinesh Hey there SQL MASTERS, here are some questions i was posed in an interview/assessment thing, dunno how well i did....Coud u answer these questions? i dont know how easy/difficut they are for u, all i know is that i had SERIOUS trouble with them! thanks alot!EMPLOYEEEmployee_id number NOT NULL (Primary Key)Employee_name VarChar(30) NOT NULL Dept_id number NOT NULL (Foreign Key to DEPARTMENT)Manager_id number NOT NULL (Foreign Key to EMPLOYMENT)Salary number Read Answers (7) | Asked by : zen Select 1 from dualunionselect 'A' from dual; I guess the query will select zero rows. Is it wrong or right ? if wrong thenWhat will be the result set for the query?Thanks in advance. Read Answers (4) | Asked by : Rachana Having following table named RATING :EmpID,ReviewSeason,CustID1,s1,c11,s1,c21,s2,c32,s2,c22,s3,c43,s3,c5Write a SQL statement, return EmpID who has been REVIEWED more than once. Giving two tables:EmpCustEmpName, CustID, EmpIDApril, 1, AApril, 3, AApril, 2, ABruce, 4, BBruce, 5, Giving two tables:EmpCustEmpName, CustID, EmpIDApril, 1, AApril, 3, AApril, 2, ABruce, 4, BBruce, 5, BCarson, 2, CCarson, 1, CCarson, 3, CDavid, 2, DCustReviewCustID, ReviewDate, EmpID1, 01-05-06, A1, 12-13-05, C2, 07-04-04, A2, 05-21-03, C2, 04-02-03, D3, 10-10-02, A3, 02-01-06, C4, 01-01-06, B5, 12-12-04, BWrite a SQL statement that return each EmpName and LATEST ReviewDate. Result should look like this:EmpName, ReviewDateApril, 01-05-06Bruce, 01-01-06... Latest Answer : Hi,You can use date functions available to get the dates of a particular monthEx: SELECT col1 FROM TABLE A WHERE TO_CHAR(DATECOLUMN,'MONYY') = 'JUN05'ORSELECT * FROM TABLE A WHERE TO_CHAR(DATECOLUMN,'MON') = 'FEB'Hope this was useful..... ... Read Answers (1) | Asked by : Saravana Kumar K Latest Answer : iif=immediate ifiif(isnull(date,0,to_char(date,'yyyy-mm'))if date is not null then 0 else to_char(date,'yyyy-mm');AS SIMPLE AS IT ... Latest Answer : yeah its very simpleuse the syntax like this:spool (you can give the path also like c:sarfarazxyz.txt)and to see that whether the result is actually stored in the file or not go to the file menu>open ...
Sponsored Links
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||