Solved

compre toata in where clue oracle

Posted on 2016-11-03
4
60 Views
Last Modified: 2016-11-04
hi am geting this error in this query invalid identifie
select itemN0, item_in_qty - nvl(qty_out,0)qty from employee,dept  
where employee.deptid = dept.deptid  
and qty > dept_qty --how can i compare the  

Open in new window

0
Comment
Question by:chalie001
4 Comments
 
LVL 50

Assisted Solution

by:Ryan Chong
Ryan Chong earned 250 total points
ID: 41873488
try:

select itemN0, item_in_qty - nvl(qty_out,0) qty from employee,dept  
where employee.deptid = dept.deptid  
and item_in_qty - nvl(qty_out,0) > dept_qty

Open in new window

0
 
LVL 28

Accepted Solution

by:
Pawan Kumar earned 250 total points
ID: 41873491
Try..

select itemN0, item_in_qty - nvl(qty_out,0) qty from employee,dept  
where employee.deptid = dept.deptid  
and (  item_in_qty - nvl(qty_out,0) )  > dept_qty

Open in new window


Try 2..


SELECT * FROM
(
	select itemN0, item_in_qty - nvl(qty_out,0) qty from employee,dept  
	where employee.deptid = dept.deptid  
)
WHERE qty > dept_qty

Open in new window

0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 41873557
I just wanted to mentioned that it is giving an error because it could not refer to the column alias qty in the where clause which you have used in the select.

As mentioned, you need to use the expression itself in the where clause or use an inline view query.

Thanks,
0
 

Author Closing Comment

by:chalie001
ID: 41873560
correct solution
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 19
Downgrading MS SQL 2008 R2 Enterprise to MS SQL 2005 Standard? 12 64
Fill Null values 5 28
oracle forms question 22 39
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

789 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