Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Unanswered: inserting rows from one table into another

    Hi,
    is there anyway of inserting all rows from one table into another with one query? I've been given the following syntax which apparently works in MS Access but it doesn't work in MySQL - it only inserts one row and doesn't generate the tranid value from the atm_id&date&time:

    INSERT INTO AtmBal( atm_id, location, date, time, type , value, TRANiD ) SELECT AtmBaltemp.atm_id, AtmBaltemp.location, AtmBaltemp.date, AtmBaltemp.time, AtmBaltemp.type, AtmBaltemp.value, atm_id & date & time AS TRANiD FROM AtmBaltemp
    ORDER BY AtmBaltemp.atm_id

    I mean, as soon as I looked at it I knew it wouldn't work in mysql but if somebody could point me in the right direction as to how I should approach this type of operation, I would greatly appreciate it

    ta
    Katherine

  2. #2
    Join Date
    Jul 2003
    Location
    Ohio/Chicago
    Posts
    75
    depends, which version of mysql are you using?

  3. #3
    Join Date
    Aug 2003
    Posts
    2
    I'm using MySQL 3.23.54

    Originally posted by unatratnag
    depends, which version of mysql are you using?

  4. #4
    Join Date
    Aug 2003
    Location
    FDR India
    Posts
    24
    Hi

    Please lookup the syntax for SELECT and INSERT, in the MySQL manual. Your "issue" is very well addressed in the manual.

    Come back here if you are still having a problem after reading the manual.

    regards
    theN

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •