EmpCust EmpName, CustID, EmpID April, 1, A April, 3, A April, 2, A Bruce, 4, B Bruce, 5, B Carson, 2, C Carson, 1, C Carson, 3, C David, 2, D
CustReview CustID, ReviewDate, EmpID 1, 01-05-06, A 1, 12-13-05, C 2, 07-04-04, A 2, 05-21-03, C 2, 04-02-03, D 3, 10-10-02, A 3, 02-01-06, C 4, 01-01-06, B 5, 12-12-04, B
Write a SQL statement that return each EmpName and LATEST ReviewDate. Result should look like this:
EmpName, ReviewDate April, 01-05-06 Bruce, 01-01-06 ...
Latest Answer : If you are trying SQL Server 2000, try the code that gives the size in bytes...DECLARE @CalSize TABLE( TabID INT, ColSize INT)INSERT INTO @CalSize SELECT A.id, SUM(A.Length) As Length FROM (Select Length, id from ...
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
Latest Answer : yes, here is an exampleSQL> CREATE OR REPLACE TRIGGER tab1_trig 2 AFTER insert ON tab1 3 DECLARE 4 PRAGMA AUTONOMOUS_TRANSACTION; 5 BEGIN 6 INSERT INTO ...
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?
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.
I am writing a script to update a value in an Oracle table. The script has a 'From' clause which Oracle does not like. Is there another way to write this since I am bringing data from 3 different tables.ThanksSamir
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.
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
What is the return value from printf() function?
printf function always returns the number of characters printed. Let us understand this with an example:
main()
{
int a=10;
printf("%d",printf("%d %d %d", a,a,a));
}
In this above program the inner printf i
The default return value from a function is int. In other words, unless explicitly specified the default return value by compiler would be integer value from function.
When a programmer wants other than integer values to be returned from function then it is essential that the pro
How does the exit () and return () differ
exit () is used to exit the program as a whole. In other words it returns control to the operating system.
After exit () all memory and temporary storage areas are all flushed out and control goes out of program. In contrast, the return () stateme
Switch statement is a powerful statement used to handle many alternatives and provides good presentation for C program. But there are some limitations with switch statement which are given below:
Logical operators cannot be used with switch statement. For instance
case k>=20:
is not allowe
Why to avoid goto in C
C has goto statement but one must ensure not to use too much of goto statement in their program because its functionality is limited and it is only recommended as a last resort if structured solutions are much more complicated.
First let us understand the goto statement, its
How To Use Proper English When You are Giving a Speech For many of us giving a speech is one of the most daunting tasks we could ever engage in You have to stand up in front of a group of people and you must speak to them about various concepts or ideas You may be nervous and if the people don t und
How To Write The Main Heading For Your Essay When you write an essay you will want to make sure you write a good heading To write a good heading you will need to plan your essay very effectively If you remember any good points from lectures these could be things you may want to use to create a good
How To Write a Good Essay While there are many different methods you can use to write an essay standard essays will follow specific formats Understanding the basic format of an essay will allow you to write informative articles which will capture the attention of those that read it mosgoogle The fir
How To Write A College Essay The best way to write a college essay is to start by brainstorming ideas You will also want to make a list of topics you re interested in While there are other ways you can write a college level essay this method is the easiest mosgoogle When you brainstorm you will want
How To Write A Killer Resume When you apply for a job it can be argued that your resume is the single most important factor to whether or not you will be hired It is not uncommon for people to spend days making sure they create the perfect resume mosgoogle Making even small mistakes on your resume c