Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

144
Views
Procedimiento de almacenamiento de JavaScript para representar REGEXP_REPLACE(variable1::string, '@|T|Z|\\(GMT-04:00\\))',' ')) >= marca de tiempo

Estoy tratando de representar la siguiente línea en el procedimiento almacenado escrito en javascript:

 ------Expected output------ select val1 from tableName where REGEXP_REPLACE(var1, '@|T|Z|\\(GMT-04:00\\))',' ')) >= date1

Actualmente, el código se ve así en el procedimiento almacenado:

 ----Actual code-------- SELECT val1 from tableName where REGEXP_REPLACE(var1,''@|T|Z|\\\\\\\\(GMT-04:00\\\\\\\\))'', '' '')) >= date1

El código anterior da como resultado el resultado esperado, sin embargo, estoy tratando de optimizar esta solución y buscando una forma más limpia de lograr este resultado final. Cualquier sugerencia es apreciada. TIA.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Aquí hay un par de métodos que podrían funcionar para usted.

 SELECT column1, REGEXP_REPLACE(column1, '@|T|Z|\\(GMT-04:00\\)',' ') || '!' as r1, LEFT(column1, LENGTH(column1)-13) || '!' as hack1, iff(column1 ILIKE '%(GMT%', substr(column1, 1, position('(', column1)-3), column1 ) || '!' as hack2 FROM values ('2021-01-22 03:40:12.000 T(GMT-04:00)'), ('2021-01-22 03:40:12.000 @(GMT-04:00)'), ('2021-01-22 03:40:12.000 Z(GMT-04:00)'), (to_char(current_timestamp))

el concat de | es mostrar el efecto de la coincidencia de espacios en blanco.

COLUMNA1 R1 HACK1 HACK2
2021-01-22 03:40:12.000 T(GMT-04:00) 2021-01-22 03:40:12.000 ! 2021-01-22 03:40:12.000! 2021-01-22 03:40:12.000!
2021-01-22 03:40:12.000 @(GMT-04:00) 2021-01-22 03:40:12.000 ! 2021-01-22 03:40:12.000! 2021-01-22 03:40:12.000!
2021-01-22 03:40:12.000 Z(GMT-04:00) 2021-01-22 03:40:12.000 ! 2021-01-22 03:40:12.000! 2021-01-22 03:40:12.000!
2022-01-21 18:50:43.554 -0800 2022-01-21 18:50:43.554 -0800! 2022-01-21 18:50! 2022-01-21 18:50:43.554 -0800!
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!