im really now with sql so can anyone give an example on this problem?
i dont know how to implement this kind of logic in sql:
if (ID != null)
else print "not available"
i was thinking about using case, but i'm not sure how to implement printing a string in a case statement using sql
sorry for the language term...i'm really used to java, so i always think in java term when im doing programming
COMPUTER.SerialNumber "Serial Number"
FROM COMPUTER left join Student
ON "Student"."ID" = COMPUTER.ID
ORDER BY COMPUTER.SerialNumber
but it gives me this error:
SELECT IF(ISNULL("PERSON"."PersonID"), 'Not Available', "PERSON"."LastName"),
ERROR at line 1:
ORA-00904: "IF": invalid identifier
why are you getting an oracle error message from mysql?
this is the mysql forum
try this, it is standard sql and works in all databases that support standard sql --
select case when is null
then 'not available'
, computer.serialnumber as "serial number"
on computer.id = student.id