How do you insert a record on the table with the same data. Only two fields differ from the existing record. And the other records must be the same as the existing on, no nulls required. The records must have same collumns but only two differ.
8 4322
How do you insert a record on the table with the same data. Only two fields differ from the existing record. And the other records must be the same as the existing on, no nulls required. The records must have same collumns but only two differ.
Is this possible? Please advice...
How do you insert a record on the table with the same data. Only two fields differ from the existing record. And the other records must be the same as the existing on, no nulls required. The records must have same collumns but only two differ.
Hi,
If you have a Table called TABLE1 with Columns A1,B1,C1,D1,
you want to insert these Table A1,C1 Columns data into another Table called TABLE2, then you just insert as follows.
INSERT INTO TABLE2
SELECT A1,C1
FROM TABLE1;
Hope you get it!
Cheers,
Vinay.
Thanx Vinay!
I hope i make this simpler this time:
I have TABLE1 with column1(must remain the same on the insewrted row) , column2, column3, column4 .Want to insert into column2 and column3 values 2579,2579. On TABLE1, the other columns can be null, column2 and column3 differ from the original row.
I hope i made it clear this time.
You can use this -
insert into table1(col1,col2,col3,col4)
(select col1,col2.'1111','2222' from table1)
here col1 and col2 are the columns which will have the same values in the table.
1111 and 2222 are constant values which will be inserted for col3 and col4 respectively
How do you insert a record on the table with the same data. Only two fields differ from the existing record. And the other records must be the same as the existing on, no nulls required. The records must have same collumns but only two differ.
give me thy tbl structure ,relations if any and some data from the tbls
where is the data you want to insert coming from? is it coming from table1 or some other source? how do you decide what column 1 should be (or is it always the same for every single row in the table).
columns 2 and 3 are to be the same number 2579, are these the two columns which must be different for each row?
You can use this -
insert into table1(col1,col2,col3,col4)
(select col1,col2.'1111','2222' from table1)
here col1 and col2 are the columns which will have the same values in the table.
1111 and 2222 are constant values which will be inserted for col3 and col4 respectively
you do realize that this will insert every row in the table again... that table will double in size each time it is ran.
you do realize that this will insert every row in the table again... that table will double in size each time it is ran.
Hi! Guys,
I apologise for not updating you, i have sorted the problem. Thanx guys for your will to help.
Regards
Nhlanhla
Sign in to post your reply or Sign up for a free account.
Similar topics
by: newbie_mw |
last post by:
Hi, I need urgent help with a novice problem. I would appreciate any
advice, suggestions... Thanks a lot in advance! Here it is:
I created a sign-up sheet (reg.html) where people fill in their...
|
by: newbie_mw |
last post by:
Seems my post was buried in more cries for help :-) I will try again.
It's probably a very novice question so please take a look! Thanks!...
|
by: Max |
last post by:
i want to insert a predefined string in a textarea when i right click
on the mouse. i need to do it in internet explorer and mozilla.
|
by: brent.ryan |
last post by:
How do I get the next int value for a column before I do an insert in
MY SQL Server 2000? I'm currently using Oracle sequence and doing
something like:
select seq.nextval from dual;
Then I...
|
by: Sergio del Amo |
last post by:
i,
I have the next html page
<html>
<head>
<script>
<!--
function insertcode()
{
var code ="<p> blablabal babala babababab</p><h1>here comes
header</h1><span>fadfafa<a...
|
by: Hervé Piedvache |
last post by:
Hi,
A small question ... and your opinions are well done ...
I have tested one thing today ...
I have a script in charge to insert a lot of files inside one of my db.
I have a perl script...
|
by: Polyhedron_12 |
last post by:
I am having problems calling functions in general in VB. I keep
getting alot of errors. Can anybody help me out with this? I put the
error message on the same line that it says it is at. I believe...
|
by: mirandacascade |
last post by:
O/S: Win2K
Vsn of Python: 2.4
Example:
<a>
<b createAnotherWhenCondition="x">
<c>text for c</c>
<d>text for d</d>
</b>
|
by: brianrpsgt1 |
last post by:
I am attempting to insert data from a HTML form using a .psp script.
I can not find how to link the data that is inserted into the form to
the variables in the .psp script to then insert into the...
|
by: ghjk |
last post by:
I'm having php page with validation. This is the code.
<script language="javascript" src="../javascripts/validate.js"></script>
<script type="text/javascript">
function valForm(){...
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |