Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

apply query after concate two column

 
deep raj
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir this isn't a JSP question...

[moderator removed the dude word]
 
Ireneusz Kordal
Ranch Hand
Posts: 423
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 618
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't you also need to add the CONCAT to the subselect?
 
deep raj
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Ireneusz Kordal and Tom Reilly
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic