September 20, 2011 at 12:38 am
I have requirement. I want use 'xyz' where ever null data is existed in the column
query is
select firstname from address where firstname is null - this gives null data
i want ti use 'xyz' insead of null.
please help me. please send me sample query . presently i am using oracle DB.
if possible please send query using pl/sql
thanks
September 20, 2011 at 1:11 am
In T SQL
Select ISNULL(FirstName, 'xyz') from tableName where firstname is null..
In PLSQL you can replace the ISNULL with NVL i guess..
September 20, 2011 at 1:28 am
Hi,
In SQL Server we have ISNULL function.
You can write your query as below:
SELECT ISNULL(FieldName,'XYZ') AS 'Result' FROM TableName
Shatrughna
September 20, 2011 at 4:47 am
Could please help me to regarding one more issue
I want to replace not null data with some other data
for Ex
In previous case we replaced null with some data. I want to do replace valid data with some other data
September 20, 2011 at 5:29 am
Hi,
Some simple example of REPLACE:
SELECT REPLACE('SQL Server Central','Server')
SELECT REPLACE(FieldName,'ABC','PQR') AS 'Result' FROM TableName
WHERE
FieldName IS NOT NULL
Shatrughna
September 20, 2011 at 5:33 am
SELECT CASE WHEN firstname IS NULL
THEN 'xyz'
ELSE 'abc' END AS new
FROM address
September 20, 2011 at 12:31 pm
UPDATE MyTable set MyField = 'MyField was NULL' where MyField IS NULL
UPDATE MyTable set MyField = 'MyField was not NULL' where MyField IS NOT NULL
September 20, 2011 at 2:14 pm
gmrose (9/20/2011)
UPDATE MyTable set MyField = 'MyField was NULL' where MyField IS NULLUPDATE MyTable set MyField = 'MyField was not NULL' where MyField IS NOT NULL
Doesn't that just updates everything?
September 20, 2011 at 3:44 pm
Ninja's_RGR'us (9/20/2011)
gmrose (9/20/2011)
UPDATE MyTable set MyField = 'MyField was NULL' where MyField IS NULLUPDATE MyTable set MyField = 'MyField was not NULL' where MyField IS NOT NULL
Doesn't that just updates everything?
:laugh: Yeah, I think that about covers it!
The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
September 20, 2011 at 3:49 pm
mtillman-921105 (9/20/2011)
Ninja's_RGR'us (9/20/2011)
gmrose (9/20/2011)
UPDATE MyTable set MyField = 'MyField was NULL' where MyField IS NULLUPDATE MyTable set MyField = 'MyField was not NULL' where MyField IS NOT NULL
Doesn't that just updates everything?
:laugh: Yeah, I think that about covers it!
For once I can do this => It depends 😀
September 20, 2011 at 3:54 pm
What kind of underwear do DBA's use?
"Depends."
The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
September 20, 2011 at 3:56 pm
mtillman-921105 (9/20/2011)
What kind of underwear do DBA's use?"Depends."
We'ev a had a few bad dba jokes thread flying around.. maybe you need to copy that over there :-D.
September 20, 2011 at 3:59 pm
Ninja's_RGR'us (9/20/2011)
mtillman-921105 (9/20/2011)
What kind of underwear do DBA's use?"Depends."
We'ev a had a few bad dba jokes thread flying around.. maybe you need to copy that over there :-D.
Sorry, I'm too stressed and busy here lately.
But only in a couple of days, I'm moving to Colorado! WOOT!
The greatest enemy of knowledge is not ignorance, it is the illusion of knowledge. - Stephen Hawking
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply