From: Quentin Bennett Date: February 16 2001 12:58am Subject: RE: If, then, else . . . List-Archive: http://lists.mysql.com/mysql/65435 Message-Id: <11C608E2636DD3118F7700805FC7FA42500A57@pegasus> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Hi, Look in the manual under Flow Control functions for use in select statements, and you should find what you need. Regards Quentin -----Original Message----- From: John Halladay [mailto:John.halladay@stripped] Sent: Friday, 16 February 2001 12:32 To: MySQL List (E-mail) Subject: If, then, else . . . If I am querying a field that has either "a" or "b" as a value and I want a second field's value to be dependant on the first field's value, how would I right that? SELECT field1, IF(field1="a",100,IF(field1="b",200,"ERROR") FROM table; The IF,THEN,ELSE is the only thing I can think of, but that is the Excel, Access side of my brain talking. Sorry for the basis question. Any help would be much appreciated. Thanks. John H. --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail To unsubscribe, e-mail Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php The information contained in this email is privileged and confidential and intended for the addressee only. If you are not the intended recipient, you are asked to respect that confidentiality and not disclose, copy or make use of its contents. If received in error you are asked to destroy this email and contact the sender immediately. Your assistance is appreciated.