If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > a tricky sql query

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-09, 17:02
darklilith darklilith is offline
Registered User
 
Join Date: Oct 2009
Posts: 1
a tricky sql query

hi all, i have a major problem in hands, i need to build a query and im hitting walls here, so ill explain the situation:
i have this 4 tables:

EMPLEA
nombre
numconemp

PLAZAS
numconemp
fectercon

PUESTO
clave
nombre
cvepro

PLA
clave
numconemp
cvepue

now..... i need to make a list of all active workers with their code and position, by this i mean the columns: EMPLEA.nombre EMPLEA.numconemp PUESTO.nombre

the condition is that PLAZAS.fectercon (which is a date field) is higher than the current date, so this would make the worker an active one (this field especifies the expiration date of his/her contract).

as u can see i have to gather fields from 2 diferent tables EMPLEA and PUESTO, but heres the trick, to know PUESTO.nombre i need to first use EMPLEA.numconemp to look for its corresponding code in PLA.clave, then i would look its position name which would be something like PLA.clave = PUESTO.clave and i would then have a fix on PUESTO.nombre

im hitting my head against the wall with this one, im using dbaccess from informix 9.0
any help will be greatly apreciated

=)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On