UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Iif In Mysql    
 
   
ayme
post Dec 4 2011, 08:23 AM
Post #1

UtterAccess Veteran
Posts: 438



i am using Navicat For SQLite .i have a simple question

how to add this in the query.

i want to show

if flags=1 then "Received" and if flags=2 then "sent"

flag is integer


my query is

select address,datetime(date, 'unixepoch', 'localtime'),text,flags
from shadow
WHERE shadow.address="123"
order by datetime(date, 'unixepoch', 'localtime')

Go to the top of the page
 
+
BananaRepublic
post Dec 4 2011, 09:54 AM
Post #2

Rent-an-Admin
Posts: 8,778
From: Banana Republic



This is off the cuff but I believe MySQL would use a IF() function or CASE WHEN ... THEN ... END. Look at MySQL's functions for details on what it can understands & expect.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 25th May 2013 - 01:35 PM