I
I
IvanN7772021-06-21 17:56:05
SQL
IvanN777, 2021-06-21 17:56:05

Specify types for hardcoded select?

Postgresql database
I have sql generated dynamically
And in order not to put questions in where conditions, I just wanted to

cross join 	(
  select null as grainGroupCode, 
       null as grainGroupName, 
       null as typeProductCode, 
       null as typeProductName, 
       null as date1 
  ) filters

But the trouble is, all such fields are perceived as strings, and filters are not required to be performed.
and (f.grainGroupCode is not null or 
    ggtpt.grain_group_id = cast(f.grainGroupCode as integer))

For numbers I do so
And for dates I don’t even know
Is it possible to set types when creating such a plate.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2021-06-21
@melkij

No need to obfuscate requests and try to confuse the scheduler. He's smart, but he's dumb.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question