This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes apply query after concate two column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "apply query after concate two column" Watch "apply query after concate two column" New topic
Author

apply query after concate two column

deep raj
Ranch Hand

Joined: Dec 11, 2009
Posts: 186
how can we apply query on column combined with two columns
i use it
SELECT CONCAT(emp_fname,' ',emp_lname) AS emp_name
FROM employee_personal
where emp_name NOT IN (select emp_name from task_allocation where proj_name='abc')

but it shows error on "where emp_name NOT IN
Hussein Baghdadi
clojure forum advocate
Bartender

Joined: Nov 08, 2003
Posts: 3476

Sir this isn't a JSP question...

[moderator removed the dude word]
Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
A column alias definied in the SELECT clause of the query can be only used in the ORDER BY clause of this query,
it cannot be used in any other clauses.
This should work:
Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
Don't you also need to add the CONCAT to the subselect?
deep raj
Ranch Hand

Joined: Dec 11, 2009
Posts: 186
Thank you Ireneusz Kordal and Tom Reilly
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: apply query after concate two column
 
Similar Threads
Hibernate Query with AND condition
Oracle Cursor
Regular expression - Pattern and matcher
Hibernate problem
Oracle Database SQL confusion