Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hi ,
i have table called Product, in that table i have two columns named first column:-Product Description, and second column :- Product name.

i need to display Product Name if front end if it is null values in db i need show product description , any one help me to write this query
Posted
Comments
AshishChaudha 14-Aug-12 1:45am    
[i need to display Product Name if front end if it is null values in db]...
I didnt understand what actually you want???

Use ISNULL : http://www.1keydata.com/sql/sql-isnull.html[^]

example :
SQL
select isnull([name],[description]) as [name] from [product]
 
Share this answer
 
try this...If I correctly understands your problem..

SQL
select (case when Product_Name is null then product_description else Product_Name end) from Product



Thanks
Ashish
 
Share this answer
 
v2
Comments
Arul R Ece 14-Aug-12 2:09am    
Hi Ashis,

The above query gives error,please check and update
AshishChaudha 14-Aug-12 2:40am    
sorry..Updated my solution...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900