Skip to main content
Incorporated comments
Source Link
Paul White
  • 90.3k
  • 30
  • 424
  • 663

I have two tables with the following columns:

Table1
id 
Sort
dou

and

Table2
id_Table1
Sort

and I need to read all values of Table1.Sort where Table1.dou = 1 and write them into Table2.Sort, into those rows where Table2.id_Table1 matches the Table1.id values.

I can do: SELECT Sort FROM Table1 WHERE dou = 1

And I can do UPDATE Table2 SET Sort WHERE id_Table1 = 'uuid'

But how can I combine these in a way that all Table1.Sort values overwrite the Table2.Sort values?

Thanks a lot for any hint!In my version of SQL92 I can use INNER JOIN statements, but I don’t know how close it adheres to the standard. I have no idea this could work with an UPDATE statement.

I'm using FileMaker SQL engine.

I have two tables with the following columns:

Table1
id 
Sort
dou

and

Table2
id_Table1
Sort

and I need to read all values of Table1.Sort where Table1.dou = 1 and write them into Table2.Sort, into those rows where Table2.id_Table1 matches the Table1.id values.

I can do: SELECT Sort FROM Table1 WHERE dou = 1

And I can do UPDATE Table2 SET Sort WHERE id_Table1 = 'uuid'

But how can I combine these in a way that all Table1.Sort values overwrite the Table2.Sort values?

Thanks a lot for any hint!

I have two tables with the following columns:

Table1
id 
Sort
dou

and

Table2
id_Table1
Sort

and I need to read all values of Table1.Sort where Table1.dou = 1 and write them into Table2.Sort, into those rows where Table2.id_Table1 matches the Table1.id values.

I can do: SELECT Sort FROM Table1 WHERE dou = 1

And I can do UPDATE Table2 SET Sort WHERE id_Table1 = 'uuid'

But how can I combine these in a way that all Table1.Sort values overwrite the Table2.Sort values?

In my version of SQL92 I can use INNER JOIN statements, but I don’t know how close it adheres to the standard. I have no idea this could work with an UPDATE statement.

I'm using FileMaker SQL engine.

edited tags
Link
Text formatting
Source Link
Ergest Basha
  • 4.5k
  • 3
  • 7
  • 21

I have two tables with the following columns:

Table1.id, Table1.Sort, Table1.dou

Table1
id 
Sort
dou

and

Table2.id_Table1, Table2.Sort

Table2
id_Table1
Sort

and I need to read all values of Table1.Sort where Table1.dou = 1 and write them into Table2.Sort, into those rows where Table2.id_Table1 matches the Table1.id values.

I can do: SELECT Sort FROM Table1 WHERE dou = 1

And I can do UPDATE Table2 SET Sort WHERE id_Table1 = 'uuid'

But how can I combine these in a way that all Table1.Sort values overwrite the Table2.Sort values?

Thanks a lot for any hint!

I have two tables with the following columns:

Table1.id, Table1.Sort, Table1.dou

and

Table2.id_Table1, Table2.Sort

and I need to read all values of Table1.Sort where Table1.dou = 1 and write them into Table2.Sort, into those rows where Table2.id_Table1 matches the Table1.id values.

I can do: SELECT Sort FROM Table1 WHERE dou = 1

And I can do UPDATE Table2 SET Sort WHERE id_Table1 = 'uuid'

But how can I combine these in a way that all Table1.Sort values overwrite the Table2.Sort values?

Thanks a lot for any hint!

I have two tables with the following columns:

Table1
id 
Sort
dou

and

Table2
id_Table1
Sort

and I need to read all values of Table1.Sort where Table1.dou = 1 and write them into Table2.Sort, into those rows where Table2.id_Table1 matches the Table1.id values.

I can do: SELECT Sort FROM Table1 WHERE dou = 1

And I can do UPDATE Table2 SET Sort WHERE id_Table1 = 'uuid'

But how can I combine these in a way that all Table1.Sort values overwrite the Table2.Sort values?

Thanks a lot for any hint!

Source Link
Loading