0

I use sql and in my query i always use 1 partition It looks like this:

select *
From people partition(x)

When i try to use another partition it fails..

Does somebody know how to add another partiton? Using comma or and or with inside the partition brackets only gives the ora-00933 sql command not properly ended error

yogy
  • 1
  • 1

1 Answers1

1

You can specify multiple partitions as a comma-separated list:

SELECT *
FROM  people PARTITION(x, y)
jarlh
  • 42,561
  • 8
  • 45
  • 63
Mureinik
  • 297,002
  • 52
  • 306
  • 350
  • When i try seperating by commas it gives me: ora-00933 sql command not properly ended :( – yogy Dec 15 '21 at 08:41
  • @yogy partiton or partition? – LukStorms Dec 15 '21 at 09:13
  • Whoops, sorry didn't notice that i wrote partiton here. In my code it's the correct partition – yogy Dec 15 '21 at 09:29
  • 1
    Until 21c the [partition_extension_clause](https://docs.oracle.com/en/database/oracle/oracle-database/21/sqlrf/SELECT.html#GUID-CFA006CA-6FF1-4972-821E-6996142A51C6) do **not** allow to specify more than one partiton... – Marmite Bomber Dec 15 '21 at 09:53
  • Well... that's a shame :( can you think of a workaround maybe? Cause not using partitions is very slow.. – yogy Dec 15 '21 at 10:08
  • Pretty simple workaround with `UNION ALL` is shown [here](https://stackoverflow.com/questions/52474515/how-to-select-data-from-multiple-partitions-in-oracle-table) – Marmite Bomber Dec 15 '21 at 11:20
  • @MarmiteBomber thanks :) – yogy Dec 21 '21 at 23:46