Skip to content

Tag: sql

Oracle date to string conversion

I have a string column COL1 when I am doing this The data in COL1 is in dd-mon-yy, eg: 27-11-89 and 89 is 1989 but the select returns it as 11/27/2089. I have to do an inner TO_DATE because if I don’t then I am getting an invalid number error (ORA-01722: invalid number) How can show 1989 instead of 2089…

SQL Copy row in a table with relations

Hope some one can help me, I would like to copy rows in same table and that table has relation to another table that I have to copy related row accordingly: Table1 I copied rows with table0Id = 3 Table1 I would like to do the same to Table2 depending to the Table1 Ids like this: Table2 Table2 As you

ORA-00904 invalid identifier error

I get ORA-00904 ‘c’ invalid identifier error. What is wrong with this alias ? Answer I think you want to fetch those records having count > 1. So you can’t use Indentifier C in the WHERE clause of the same query.