Hi there:

I was wondering if it's possible to perform an "elseif" in SQL Using MySQL
3.23.49-log running on Debian Linux?

My System:
----------

* MySQL 3.23.49-log
* Debian Linux
* PHP 4.2.1

The Logic:
----------

IF condition1 - THEN query column1.
ELSEIF condition2 - THEN query column2.
ELSE condition3 query column2.

The SQL: (more pseudo code than anything else)
----------------------------------------------

SELECT a,b,c
FROM companies
WHERE
IF(subscription AND no module , bitwise-data & column1
ELSEIF no subscription AND no module , bitwise-data & column2 ,
ELSE bitwise-data & column2)
ORDER BY a";

The "bitwise-data" is an integer bit from a URL Query String, it needs to be
compared with one of two columns (column1 or column2) but which column is
used depends upon whether a company has a subscription or not.

I really hope this makes sense. Are there any SQL gurus out there who might
be able to help here?
Many Thanks.


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to