Can we call a function in sql query and what are the pre requisites to call a function in sql query?
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?
Latest Answer : select distinct (a.sal) from emp a where &n=(select count (distinct(b.sal)) from emp b where a.sal
In Mysql, which one character is used to complete the query and get the input. In other words, we can write the query in multiple lines. How to terminate the query?
semicolon ' ; '
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
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.
My problem is i have a two tablestable1customercustid custnametable2custaddrcustaddrid custaddrstr custid datei have different records for each custid in custaddr table. say for example for the first customer we have 6 records in custaddr table. so i want the latest dated record from the custaddr table. ie to find the maximum date. pls somebody can write the query for this, i have tried but not able to find the max of the dates.thanks in advance
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..... ...
Latest Answer : check this link.....http://asktom.oracle.com/pls/ask/f?p=4950:8:16663421538065257584::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:766825833740 ...
The table name is emp(many fields) with 'designation' as 1 field. my query is i want the percentage of "MANAGERS" in that emp table. (suppose there are 14 rows in total, the rows with 'managers' are 3, so output is (3/14)*100 ).