Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 urgent help

Author  Topic 

drm_mmon
Starting Member

6 Posts

Posted - 2007-08-06 : 21:39:27
Hello Friends,
I have a table with 3 fields
ExecutiveId
CompanyName
Title

One person can have 10 year of experience and two jobs/companyname and other person can have 5 years of experience and 5 jobs.
i want to know all executives with maximum years of experience and minimum years of experience. What should be the query? Thanks

Koji Matsumura
Posting Yak Master

141 Posts

Posted - 2007-08-06 : 21:45:22
There is no time length information in your table.
Go to Top of Page

drm_mmon
Starting Member

6 Posts

Posted - 2007-08-06 : 21:52:20
I know there is no time given. Position shows you different titles for an example CEO, CTO and this is the question being asked to me in the interview and i have to answer this question in my second round of interview tomorrow. I really need the answer. This is the table i was given.If i write it something like this
Select Executiveid, count(Executiveid) from table Group by experience id
order by what??????
Please help me. This is the only info i was given. Thanks
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-08-06 : 22:00:29
There isn't sufficient information to do the required query.


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

drm_mmon
Starting Member

6 Posts

Posted - 2007-08-06 : 22:10:10
Not for the question i asked you but first he had asked me some other question from a table executive
Field Name
Executive Id
First name
Last name
CompanyID
I had asked him that i should be using this table too and he said not necessarily.
Anyways, do you think that if i have to join with this table then i can get the result.Please help.
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-08-06 : 22:29:19
maybe it is a trick question.

The table does not even contain any information on date / time, and you want a query that tells you the max / min of time ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

drm_mmon
Starting Member

6 Posts

Posted - 2007-08-06 : 23:32:22
Thank You! May be it is a trick question. I don't know what am i going to tell him tomorrow? Anyways, thanks
Go to Top of Page

Lamprey
Master Smack Fu Yak Hacker

4614 Posts

Posted - 2007-08-07 : 11:46:23
Also, You can tell them it makes no sense because POSITION has no meaning in a set. (yes, even if it has a clustered index :).
Go to Top of Page
   

- Advertisement -