SQL Recipes
A FREE cookbook for SQL queries and examples
Register FAQ Search Today's Posts Mark Forums Read

SQL - Questions and Answers Have a SQL question? Post it here. First do a search to see if someone hasn't already answered it.

Go Back   SQL Recipes a FREE cookbook of SQL queries and examples > SQL queries and examples > SQL - Questions and Answers

Reply
 
LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 07-22-2008, 01:07 PM
arun arun is offline
Junior Member
 
Join Date: Jul 2008
Posts: 9
arun is on a distinguished road
Arrow ANY dialect question:

error returned for a query containg case


THIS IS MY TABLE

EMPNO JOB MANAGER
========= =============== ==============
101 ENGINEER ASAD
102 ACCOUNTANT ARJUN
103 OFFICEBOY KIRAN
111 DRIVER VARUN
104 LIFT OPERATOR CHRISTY

since the table is not clear here i will explain
the table contains an empno column of integer type,job column of varchar type and a manager column of varchar type with the shown values



THIS WAS MY QUERY
select case
when((select count(empno) from employee where manager='asad')=1)then 'more than one employee'
else(select empno from employee where manager='arjun')
end
from employee where manager='arjun'

AND THE FOLLOWING WAS THE ERROR SHOWN FOR THE ABOVE QUERYConversion failed when converting the varchar value 'more than one employee' to data type int.
THANKS IN ADVANCE ........ FOR HELP

Last edited by arun : 07-22-2008 at 01:29 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Be the first to answer this question! Click on the 'Post Reply' button below.
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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



All times are GMT. The time now is 10:17 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
Copyright (c) 2006-2008 SQL Recipes

1 2 3 4 5 6 7 8