Home > database >  select difference in (H2 database) vs (Postgres database)
select difference in (H2 database) vs (Postgres database)

Time:03-01

I want t know the difference of Select * from difference in H2 vs in Postgres.

I have initially have an XML with terms to, aaa, apple, kite, potato in this

I have a program that imports and exports the XML containing the above words. and than a query that does "Select * from" and later exports the XML again.

For H2 it gets order alphabetically but for Postgres it remains the same. How does Select between H2 and Postgres work?

CodePudding user response:

Rows in a relational database have no implicit sort order. Without an order by clause the database is free to return the rows in any order it likes. Any "order" you see, is pure coincidence.

If you need to rely on a specific sort order, you have to use an ORDER BY clause with your SELECT statement. There is no alternative.

  • Related