473,387 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

no return value from empty table

Hi list,

I'm new here so I don't know if this has been discussed earlier.

I have a problem with the following:
SELECT IF(column = 'string', 'a', 'b') AS test FROM table;

It works just fine if the table is populated. However, if the table is empty
(which this one very well can be from time to time) I get no return value at
all.

Is there any way I can get MySQL to return "test = b" if the table is empty?

/T
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1386

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: jason | last post by:
Access 2000 I need some help interogatting a table and extracting via ASP the final field in a row which has a value. In other words, I have a maximum of 10 fields but, at the user level he may...
0
by: Thomas Svenson | last post by:
Hi list, I'm new here so I don't know if this has been discussed earlier. I have a problem with the following: SELECT IF(column = 'string', 'a', 'b') AS test FROM table; It works just fine...
6
by: michael | last post by:
Below is a simplified version of table cell mouseover script, running separate from the HTML code, that was posted on this group yesterday: var d=document, td; function mover(){...
5
by: drdave | last post by:
Hi, I have 6 forms being generated using coldFusion, they are named special1, special2 special3 and so on.. in these forms I have a link to open a new window. I am trying to pickup the...
18
by: Pedro Pinto | last post by:
Hi there once more........ Instead of showing all the code my problem is simple. I've tried to create this function: char temp(char *string){ alterString(string); return string;
2
by: mstng07 | last post by:
How can i get a return value of 1 if the user exists in the table instead of it returning a -1? <?php require("config.php"); if($_GET == 'post') { if(empty($_POST) || empty($_POST) ||...
12
by: Eric Kaplan | last post by:
I have a function like this ============= bool Table::Get(char* FieldName, char* FieldValue) and I call the function like the follow ============= while(!tbl.ISEOF()) { char id2;...
1
by: pechar | last post by:
Hi Guys, I'm having problems returning a set of rows. What I have is two tables, one to store properties and another storing the images (image paths) of the properties. Now a property isn't...
50
by: Bill Cunningham | last post by:
I have just read atoi() returns no errors. It returns an int though and the value of the int is supposed to be the value of the conversion. It seems to me that right there tells you if there was...
4
by: wizardry | last post by:
hello - i've created a form that has multiple inserts. it inserts the data fine if i manually parse the data to it but when i use the form to test the inserts it errors out. it errors out at...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.