1

I'm very new to coding, so I'm sure that I'm missing something simple, but I've been struggling with it for a while now.

I can use the following query to create a desired view in a locally hosted database on MySQL Workbench:

CREATE VIEW <new_view> AS SELECT *, ROW_NUMBER() OVER (ORDER BY <column_1> DESC) FROM <table_name>;

But when I try to use the exact same code for a database that I've linked to ClearDB, it either doesn't even highlight ROW_NUMBER and OVER as being legit commands or (if I go into manually creating a VIEW) it tells me that I have an error in syntax, and the parenthesis after OVER isn't expected.

I've tried copy and pasting the exact code from the database that it works in, and I tried making a VIEW that was an exact copy of the table, and then altering the DDL, but again, it shows that I have an error in my syntax at that parenthesis.

I'm guessing that there is some syntactical difference in ClearDB, when dealing with ROW_NUMBER and/or OVER, but I haven't been able to find any information on it.

NewDev94
  • 11
  • 1
  • I don't know what ClearDB is, but it's not MySQL. Every DB has their own syntax; the fact that a query works in another DB doesn't really mean anything. You may want to rework this question keeping that in mind, though it sounds like this problem could be resolved by checking the documentation for the syntax you're trying to use. – miken32 Aug 27 '21 at 00:40

0 Answers0