I am trying to insert records into a mastertable. The first field is auto-incrementing and therefore I am unable to insert all records at the same time. I have create the following code to insert one record in at a time. insert into `mastertable3` select ' ', 0301_2500.ssn, 0301_2500.vsssn , 0301_2500.name_ ind, 0301_2500.pay_g r_aa from time_period, Mastertable3 right join 0301_2500 on mastertable3.ss n = 0301_2500.SSN where (((if(mastertable3.s sn=0301_2500.ss n, 0, 1))=1)) limit 1
I am trying to create a loop to have this repeat continuously until the table 0301_2500 is exhausted, then switch to table 0302_2500, and etc...
Any ideas?
3 2257 mwasif 802
Recognized Expert Contributor
Mention the column names in INSERT statement except auto increment field e.g. - insert into `mastertable3` (field1,field2,field3,field4)
-
select 0301_2500.ssn, 0301_2500.vsssn, 0301_2500.name_ind, 0301_2500.pay_gr_aa
-
etc..
Didnt work. I believe the problem is that it can not generate multiple auto_incremente d numbers simultaneously. I would like to figure out how to do this with looping. Any links or walk throughs on looping would be helpful.
Didnt work. ...
What had you tried and what happened when you tried it?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Benjamin Dickgießer |
last post by:
Hi, I want to create a sql query but don't know if this is possible with
mysql.
The Query should do the following:
Select all db entries from table in which entry a is smaller than the number
(count) of all db entries with criteria x from another table.
Thx for your help!
Benjamin Dickgießer
|
by: aaron |
last post by:
I have a question about (i think) joining.
If I have a table in a database that has this info:
key - name - favorite
1 - john - 2
2 - judy - 3
3 - joe - 1
the favorite icecream table is this:
|
by: Xenophobe |
last post by:
I know this isn't a MySQL forum, but my question is related to a PHP
project.
I have two tables.
table1
table2
"table1" contains 2 columns, ID and FirstName:
|
by: Nick |
last post by:
hi, all
I convert some code from access to mysql. And I have a InboxMessage
table which has From and To field.
So, the query is like:
select * from InboxMessage where To=12
12 is user id.
This query works fine in access. But does not work in Mysql.
I think the problem is the field To, which must be a keyword in mysql.
So, how to fix this? I don't want to change the field, becuase this
will need to change a lot of code.
|
by: talktozee |
last post by:
Hello, everyone!
Here's are the basics:
1. The query looks at all positions that are active and haven't been filled.
2. It then has to look at every single position and determine three things:
Does the person running the query (via an ASP page) have certain rights?
a. Recruit rights
b. Enlist rights
c. Take rights
| |
by: fusonts |
last post by:
Can someon show me how to wirte a mySQL search query to search from only the open records. This is what I have but it continues to return records that are closed so I'm obviously doing something wrong. I've also tried, Where Closed = 'N'
SELECT *
FROM my Table
WHERE Closed != 'Y' And Actionee LIKE '%colname%' OR Responsible_Org LIKE '%colname1%' OR Source Like '%colname2%' OR id LIKE '%colname5%'
ORDER BY id ASC
Any direction would be...
|
by: xoinki |
last post by:
hi all,
I wanted to know few general details about MySQL slow query log.
My slow log has a statement like
# User@Host: root @ localhost
here, what does this "" signify? why is this needed?
I could not find any documentation expaining slow query log format.
Regards,
|
by: dvelst |
last post by:
Hi All,
I have the following query which was based on a working query in MySQL:
(don't be afraid of the size of the query you see below, later on I will concentrate on part of this query)
SELECT count(*) FROM ((SELECT * FROM tileinfo where julianDay BETWEEN DATE2JDAY(('2003-03-01 00:00:00'),0) AND DATE2JDAY(('2003-03-01 23:59:59' ),0) AND intersects(tile, geomFromText('POLYGON((-10.84 35.8,18.14 35.8,18.14 59.41,-10.84 59.41,-10.84...
|
by: secutos |
last post by:
I have the option of storing data online as text files, or storing data online in a MySQL database. If the information is stored as a text file, all I have to do is a HttpWebRequest to the text file to retrieve the information. I'm willing to store the information in a MySQL database if its faster. For you who want to know what I'm doing to provide a better solution, I'm simply communicating client and server through the web. I don't want to use...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |