Hi all , I dont know much about programing i have some questions about DBMS. please help me. Using aggregate functions solve these questions The questions is 1. Find the first and second largest salary of the employee ? 2.Display the odd number record ? 3.Display the even number record? give me the syntax. Thanks, seopigeon
what database are you using ? MySQL, MSSQL, Access (just a wild guess it's the third one Can you post the structure ?
You can do is sort the table based on the salary field and extract the top two... As for the others... will definitely need the structure of the tables..
1. select * from table order by salary desc limit 2 2. & 3. - the best way i can think of doing this is to sort the query by salary and then parse the recordset.
i dont know exact structure table.please give me the syntax its ok. we have to use only aggregate functions to solve these question.
Then everyone is just p***ing in the wind. Also, your question is a bit vague - what exactly do you mean by odd and even number records?
I think he means, only display the odd numbered records, 2,4,6 etc. If so, prehaps you could do SELECT id FROM blah WHERE blah%2 SELECT id FROM blah WHERE blah!%2 (syntax is probably wrong on that one, havent tested it)