adspace


How to implement if-then-else in a select clause in sybase?

Answer Posted / Avinash Pandey

Sybase does not directly support the IF-THEN-ELSE construct in the SELECT statement. However, you can achieve similar functionality using CASE expressions:

```sql
SELECT column1,
CASE
WHEN condition1 THEN value1
WHEN condition2 THEN value2
ELSE default_value
END AS new_column
FROM table_name;
```

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

No New Questions to Answer in this Category !!    You can

Post New Questions

Answer Questions in Different Category