Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Old 08-31-2004, 05:50 PM MySQL, SQL IFNULL
wbmstr2good's Avatar
Average Talker

Posts: 22
Trades: 0
How do I properly use this function in an SQL query. This is how I'm doing it:

SELECT EVENTID, USERNAME, IFNULL(COMMENTS, "") FROM EVENTS;

What am I doing wrong?
wbmstr2good is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-31-2004, 06:16 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
Seems correct to me, are you getting any errors? What version of mySql are you running?
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 08-31-2004, 06:26 PM
wbmstr2good's Avatar
Average Talker

Posts: 22
Trades: 0
I'm running the ODBC connector 3.51 and the error I'm getting is as follows:

ADODB.Recordset error '800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/manageevents.asp, line 35

And here is Line 35:

strComments = adoRS("COMMENTS")
wbmstr2good is offline
Reply With Quote
View Public Profile
 
Old 08-31-2004, 06:29 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
Try this:

SELECT EVENTID, USERNAME, IFNULL(COMMENTS, "") as COMMENTS
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 09-01-2004, 01:34 PM
wbmstr2good's Avatar
Average Talker

Posts: 22
Trades: 0
got it, I was using double quotes instead of single, and no AS columnname
wbmstr2good is offline
Reply With Quote
View Public Profile
 
Old 04-23-2009, 03:24 AM Re: MySQL, SQL IFNULL
Junior Talker

Posts: 1
Name: divyesh
Trades: 0
SELECT EVENTID, USERNAME, IFNULL(COMMENTS, "") AS COMMENTS

its the default syntax of if condition in mysql
divyesh is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to MySQL, SQL IFNULL
 

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27826 seconds with 12 queries