![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#3
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#4
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#5
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#6
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#7
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#8
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
#9
| |||
| |||
|
|
Hello, I am importing an old database into a new one with a new data structure, in order to map the old relations to new ones I need to perform some weird queries during the data import, now I have a problem that I cannot solve, I have the result of this query: select key_field, min(cast(date1)) as d1, min(cast(date2)) as d2, min(cast(date3)) as d3, min(cast(date4)) as d4, min(cast(date5)) as d5, min(cast(date6)) as d6 from import_table group by key_field; now, I have to calculate the min of d1, d2, d3, d4, d5, d6 for *each* query, but I cannot find out a method to force min() to work on single rows, even with a subquery. Any tip? |
![]() |
| Thread Tools | |
| Display Modes | |
| |