Author Topic: SQL statement (moving field contents)  (Read 5897 times)

0 Members and 1 Guest are viewing this topic.

Offline skittle

  • Member
  • *
  • Posts: 13
    • View Profile
SQL statement (moving field contents)
« on: January 13, 2012, 09:43:33 pm »
Hi everybody,

I want to do following:

Take the information of movies field A and move it to the custom field B for every single movie I have in my database.

What I am thinking of is writing a short SQL like following:

UPDATE customfields_table C SET C.mycustomfield=(SELECT M.release FROM movies M);

The question is how to find out the right column and table names of the custom field (marked red)? Or is there an out-fo-the-box way to do what I am attempting to?

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: SQL statement (moving field contents)
« Reply #1 on: January 13, 2012, 10:38:16 pm »
Quote
The question is how to find out the right column and table names of the custom field (marked red)?

Assuming you understand SQL and know how to use the SQL tool (on the Help menu when the program is started with the -debug switch), you could get those using an SQL query tool like FlySpeed SQL Query.

Quote
Or is there an out-fo-the-box way to do what I am attempting to?

Not exactly "out-of-the-box," but you could export [A] with [Title], [Year] and/or [ID] (to match records) and import the A data to [B].