I have a statement which Inserts a new row to the table in my database, but the new row is added on the first row of the table. I want to add a new row on the end of the table, how would I do this?
INSERT INTO myTable(IFACTUURREGELNUMMER, FACTUURNUMMER, REGELNUMMER, KOSTCODE, DOSSIERNUMMER, OMSCHRIJVING, RELATIE, PRIJS, AANTAL, BEDRAG, VALUTA, BTWCODE, BTWBEDRAG)
VALUES (@INVOICELINENUMBERM, @INVOICENUMBER, @RULENUMBER, @COSTCODE, @CASENUMBER, @DESCRIPTION,@RELATION, @PRICE, @QUANTITY, @AMOUNT, @CURRENCIES, @BTWCODE, @BTWAMOUNT)
There is no first or last in a table.
Anyway: You can use
ORDER BYYou can also have multiple expressions in the
ORDER BYSome Database Managment Systems (DMS) like Oracle or Postgres also allow you to order by
NULLS: