Skip to content
Advertisement

Tag: case

Case when date = current_date then text

I have a table like this: But when I execute this query: I get this result: SQL Fiddle I would expect that in the rows where is_equal is true, the result should be TODAY. What am I doing wrong? Answer Nevermind, I solved it, but I don’t want to discard the question. The solution is to CAST(token_date as varchar) in

SQL CASE Expression

I need to write a sql statement(Oracle) where I can withdraw data from two diff tables and check for a condition and return a certain string. My statement goes like this, When I run this I get a error: “FROM keyword not found where expected”and points to the c in line 2. and if I change the from to line

Swapping one column to another

There are n number of parent tasks and each task has their actual start time and actual end time, now there are child task as well, for one parent task which ends with ‘createprovision’ i want to replace the end time with the start time of the child task which starts with ‘Preparations’ Sorry I am editing the question The

SQL CASE statement needs to handle Text

Apologies if this has been asked before – I’ve spent a couple of hours searching but not found anything that’s helped. It’s quite simple really – I’ve been asked to create a query which includes a field that when it was set up (not by me) was created as a VARCHAR instead of an INT. I need to do some

Advertisement