473,320 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Newbie basic SQL question.

I've been asked to extract some data from tables in Oracle for
importing in to Lotus Notes, and am struggling over the SQL which is
probably very simple (if you know what you are doing).

There's a table that contains an employee's past present [and future]
jobs. Each row will have the employee id, job title, and effective
date (that they started / will start that job).

All I need to find is the employee's *current* job title.

Whatever I try seems to generate an error, either grouping not allowed
in that context, or missing right parenthesis. My latest attempt is:

Select JobTitle from T_Jobs where emplid="12345" and effdt=(Select
max(A2.effdt) from T_Jobs A2 where emplid = A2.emplid and A2.effdt <=
sysdate)

Where JobTitle is the column I want, emplid is the employee id, and
effdt is the date that record is effective from.

Could someone please point me in the right direction.

Thanks - Rufus.
Jun 27 '08 #1
0 945

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: gozu | last post by:
Here is my query: SELECT departments.department_name AS "Department name", locations.STREET_ADDRESS AS "Mailing address", locations.city, locations.state_province, locations.postal_code FROM...
7
by: Bruno43 | last post by:
Hi I am trying to learn Visual Basic and I am getting everything for the most part, mainly because of my ability to read code like a book, but my question is what is the best way to Navigate through...
1
by: Twayne | last post by:
Hi, Complete newbie here, no C or related language background; starting from the basics. I DO have Visual Basic 6 (non .NET) and batch file experience, but that's all. I have the following...
16
by: Raxit | last post by:
Hi, i was reading/learning some hello world program in python. I think its very simillar to Java/C++/C#. What's different (except syntax) ? what can i do easily with python which is not easy...
0
by: Rauf Sarwar | last post by:
Originally posted by dreimer You have to use ODBC/ADO etc to connect to the database. I don't know the exact syntax but you can search in comp.lang.visual.basic NG. Another suggestion.... dump...
6
by: HightowerC | last post by:
Wow...reading this group is a little overwhelming. Hope I'm posting to the right place. I'm a newbie when it comes to VB and .NET, but my company is making a move in that direction. Just looking...
10
by: mcl | last post by:
Why can I not the change the value of a variable in another class, when I have passed it via a parameter list. I am sure I am being stupid, but I thought passed objects were Read/ Write eg...
3
Lokean
by: Lokean | last post by:
Sorry for this newbie question, this is not my realm of expertese. I have searched google, tried several applications that claim they can do this, such as Mapforce, which I found confusing, to...
8
by: jch | last post by:
Sorry for the newbie question but I'm trying to learn Visual Studio. I've got VS Express 2008 and I'm using visual basic. I'm trying to learn how to deploy a program so I've written a very basic...
4
by: djminus1 | last post by:
I am attempting to build a RIA using Flex3, PHP, and MySQL. I am really a newbie when it comes to MySQL. I need some help in desiging my database for this application. My application will allow...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.