Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

query and subquery

Posted on 2011-05-10
4
Medium Priority
?
246 Views
Last Modified: 2012-06-21
Hi,
i have two querys:
in query main i need "Estacion_Origen". This values is in WRS_SP_ObtenerSolicitudSeg: (s.intidpaso,  pa.varnompaso as vardespaso)
Do not understand why this query:
(
SELECT MAX(TO_CHAR(S.INTIDPASO) ||'' - '' || TO_CHAR(PA.VARNOMPASO))
FROM SOLICITUDSEGUIMIENTO S,
     PASO PA,
     PERFIL  PF
WHERE S.INTIDNUMEROPROVISION = SR.INTIDNUMEROPROVISION
      AND SOL.INTIDNUMEROPROVISION = SR.INTIDNUMEROPROVISIONORI
      AND S.INTIDPROCESO = PRO.INTIDPROCESO
      AND S.INTIDPASO = PA.INTIDPASO
      AND PRO.INTIDPROCESO = PA.INTIDPROCESO
      AND S.INTIDDECISION = PAR.INTCODPARAMETRO
      AND S.INTIDPERFIL  = PF.INTIDPERFIL ) AS "Estación Origen",
BRING ME NO VALUE


queryMAIN.jpg
queryMAIN.txt
WRS-SP-ObtenerSolicitudSeg.jpg
WRS-SP-ObtenerSolicitudSeg.txt
0
Comment
Question by:enrique_aeo
  • 2
4 Comments
 
LVL 41

Expert Comment

by:Sharath
ID: 35734145
>> Do not understand why this query:
What is your question here?
0
 
LVL 23

Accepted Solution

by:
OP_Zaharin earned 2000 total points
ID: 35734182
- check your WHERE clause condition if its all met. if any of the condition fail will results to no value.

      WHERE S.INTIDNUMEROPROVISION = SR.INTIDNUMEROPROVISION
      AND SOL.INTIDNUMEROPROVISION = SR.INTIDNUMEROPROVISIONORI
      AND S.INTIDPROCESO = PRO.INTIDPROCESO
      AND S.INTIDPASO = PA.INTIDPASO
      AND PRO.INTIDPROCESO = PA.INTIDPROCESO
      AND S.INTIDDECISION = PAR.INTCODPARAMETRO
      AND S.INTIDPERFIL  = PF.INTIDPERF
0
 

Author Comment

by:enrique_aeo
ID: 35734195
I need to see change querymain "estacion_destino. " This value is shown in WRS_SP_ObtenerSolicitudSeg: (s.intidpaso, pa.varnompaso as vardespaso)
0
 

Author Comment

by:enrique_aeo
ID: 35734298
sorry, "estacion_origen"
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question