title: How to find the position of the primary key which is varchar GUID generated by application row in Oracle
body: <p>So my use case is i have to find the location of the primary key column so that i can write query like <code>select * from my_table where ID &lt;='00000536-37ee-471c-a8e0-3d233b8102f5'</code></p>
  
  <p>So my table has a primary key which is varchar type and values of the column is GUID generated by an application.
  Here is an example of primary key </p>
  
  <pre><code>000000bd-104e-4fd6-a791-c5422f29e1b5
  0000016e-7e68-4453-b360-7ffd1627dc22
  00000196-2dba-4532-8cba-1e853c466697
  0000025a-cfae-41b4-b8e7-ef854d49e54a
  00000260-8bdb-4b30-acdb-5a67efd4dbfe
  00000366-552d-48a0-b8a1-20190ccd087c
  000003f2-d6d8-4a51-96cc-407063bc568b
  000003ff-3d16-4e88-9cf3-bcdf01c39a2b
  00000487-1e6c-4d6d-a683-6f11d517962c
  000004cc-6359-4a9a-aa2a-70a6b73a06b1
  00000536-37ee-471c-a8e0-3d233b8102f5
  </code></pre>
  
  <p>Now i need to use this table in aws DMS which accepts only query like select * from table where column =,&lt;=,>=</p>
  
  <p>My use case is to find the exact location of the millions of GUID so that i can divide table into multiple query and select based on GUID .
  For example if we have 100th GID is 00000536-37ee-471c-a8e0-3d233b8102f5 then i can write query like <code>select * from my table where GUID &lt;=100</code> </p>
  
  <p>The limitation is i can not add any new columns in the existing table because application impact is huge .</p>
  
  <p>How can i do this ?</p>
  
  <p>One Option that i thought but wanted to confirm is below </p>
  
  <ol>
  <li>Create a temp table </li>
  <li>Temp table will have auto generated sequence and ID column</li>
  <li>Inset into temp table select only GUID from main table with order of GUID .</li>
  </ol>
  
  <p>In this case the value will be stored on order and i an first select GUID based on 100th number and then i can pass that GUID and write my oroginal query </p>
  
  <p>But i am not sure whether this will work on not 
  Can some one suggest on this or suggest some other option ?</p>
  
  <p><strong>So let me explain what i want .</strong></p>
  
  <p>I want DMS to read may main table in parallel and migrate .
  So lets say one DMS task can read nd migrate from 1 to 100,another 100 to 200 another >200 like that .</p>
  
  <p>Currently i can not do because we dont know the position of the primary key and write the query .</p>