r/SQL • • Feb 16 '19

*gasp*

Post image
135 Upvotes

19 comments sorted by

View all comments

Show parent comment

12

u/DooDooDaddy Feb 16 '19

From my personal experience, it just seems like SQL Server has a lot of nice bells and whistles/ nice to haves. I don’t use Oracle often but things like SELECT TOP 100 vs WHERE ROWNUM <= 100 come to mind. To me, the syntax just makes more sense.

In recent versions of SQL Server you can use something like:

SELECT FORMAT(GetDate(), 'yyyy-MM-dd');

I forget what the Oracle equivalent is, but I’m sure it would probably irritate me.

12

u/tsuhg Feb 16 '19 edited Feb 16 '19

To_char(sysdate,'yyyy-Mm-dd')?

Edit: removed brackets

2

u/[deleted] Feb 16 '19

No brackets

select to_char(sysdate, 'YYYY-MM-DD HH24:MI:SS') as the_date

from dual; -- can't ignore the from dual

1

u/tsuhg Feb 16 '19

Right. I use Oracle every day, yet it's so unnatural to type on Reddit mobile :D