Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Thank u Chirag

Author  Topic 

kalaivani
Starting Member

11 Posts

Posted - 2007-12-18 : 02:16:14
Thank u Chirag....

but i should display all the records of that table not only price column.

consider the column price in titles table in pubs database. If the price of any record is not defined it should be retrieved as -9999.

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2007-12-18 : 02:17:57
[code]
Select IsNull(Price,-999) From Titles
[/code]

Chirag

http://www.chirikworld.com
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2007-12-18 : 02:40:15
I Guess.. do specify all the columns then..

Select Title_Id, Title, .... From Price

I guess you require to learn the basics about the SQL.. you can check out the following sites.


http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp

All the best..

Chirag

http://www.chirikworld.com
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2007-12-18 : 02:40:56
Select IsNull(Price,-999) AS 'Price',
{other fields from table comma seperated}
From Titles
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-12-18 : 02:58:41
quote:
Originally posted by visakh16

Select IsNull(Price,-999) AS 'Price',
{other fields from table comma seperated}
From Titles



Dont use single quote around column names

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -