Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15947

How to duplicate a column in the same table (SQLite)

$
0
0
Hello!

Using an SQLite db, I'm trying to duplicate all the records from one Column1 to the Column2, so Column1 has about 50 rows but only 2 records the rest of the cells have NULL values. Column2 is empty, it has nothing but NULL values. I've already googled it and I find nothing.

My table has no PK, no constraints, no foreign Keys, and all columns are TEXT type.
When I use the following code to try duplicating those records, it duplicates the same value in all the rows in Column2
VB.NET Code:
  1. Using Kommand As New SQLiteCommand("UPDATE Employees SET Admin_06  = Admin_05, ConnectionSQL)
  2.                 Kommand.ExecuteNonQuery()
  3.             End Using

This is what I get:

Name:  Captura de pantalla 2020-09-30 000224.png
Views: 39
Size:  14.9 KB
I want to literally clone column Admin_05 into Admin_06.

I'll appreciate any help.
Attached Images
 

Viewing all articles
Browse latest Browse all 15947

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>