Hi,
I have image in database tables. I want to make a duplicate row of aving the image. how can i do it ?
query like:
insert into table_name (image_column) values (select image_column from table_name);
Above query is not working.
Thanks in advance.
That's because you're trying to mix different formats of the INSERT syntax. Looking at the manual page, you'll find the proper syntax for an INSERT .. SELECT query to be:
INSERT [LOW_PRIORITY | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [(col_name,...)] SELECT ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ]
I am sorry
but i could not understand, when i am inserting the same data in same table, then how it is different format. i am running select statement from blob datatype and inserting the record in a blob datatype.
Please advice.
I meant you're trying to mix the different syntaxes for the "INSERT" command. If you'll look at the manual (or even the explanation that I quoted), you'll see that the INSERT command is different when you're SELECT'ing data. One difference is that there is no VALUES() part.
Thanks, got your point.
So does that mean you resolved this issue? If so, don't forget to mark the thread resolved (and perhaps post the final query you came up with).