473,803 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SELECT INTO another file WHERE records with duplicate data INTO another file

1 New Member
Hi,
I create a script to pick up those records with duplication of IMIPROPSERVNO field, see below test1.sql, which is working....
test1.sql
1.SELECT IMIPROPSERVNO, COUNT(*)
2.FROM INSTALL_MASTER# IMIPROPSERN
3: GROUP BY IMIPROPSERVNO
4: HAVING COUNT(*) > 1;

Now, I want a list of records in INSTALL_MASTER# IMIPROPSERN where the count > 1, ie those records with duplicated IMIPROPSERVNO.
I tried the following but did not work...how I can I fix the following ?

1: SELECT IMKEY, IMIPROPSERVNO INTO dup_propservno
2: FROM INSTALL_MASTER# IMIPROPSERN
3: GROUP BY IMIPROPSERVNO
4: HAVING COUNT(*) > 1;

When run,
SQL> @IMIPROPSERVNO. sql
SELECT IMKEY, IMIPROPSERVNO INTO dup_propservno
*
ERROR at line 1:
ORA-00905: missing keyword


p/s how can i include the count(*) into the select file?ie
(SELECT IMKEY, IMIPROPSERVNO, COUNT INTO dup_propservno)

Thanks
Pek
Oct 25 '06 #1
0 2000

Sign in to post your reply or Sign up for a free account.

Similar topics

9
5983
by: atse | last post by:
Hi, My table in the database may contain duplicate records, which means except the primary key (auto_increment) field is unique, all or almost of all the fields are with the same content. How can I select them to display and delete them? Thanks for any idea. Atse
5
11510
by: malcolm | last post by:
Example, suppose you have these 2 tables (NOTE: My example is totally different, but I'm simply trying to setup the a simpler version, so excuse the bad design; not the point here) CarsSold { CarsSoldID int (primary key) MonthID int DealershipID int NumberCarsSold int
8
11116
by: Rich | last post by:
My table looks like this: char(150) HTTP_REF, char(250) HTTP_USER, char(150) REMOTE_ADDR, char(150) REMOTE_HOST, char(150) URL, smalldatetime TIME_STAMP There are no indexes on this table and there are only 293,658 records total.
7
3284
by: Amy | last post by:
I'm trying to add an autoincrementing id to a table based on an existing field Name, but Name has duplicated records. How can I do that in ACCESS? Thanks. Amy
11
4082
by: BillCo | last post by:
I'm using a backend that's been around for years before I joined the company. It kind of grew exponentially and has some design problems including large unused tables some temporary tables. It compacts to 150Mb, but after a day it's up to 300Mb and it gros steadily from there. I need to: (a) reduce the size (b) reduce the bloat factor Apart from moving the temporary tables to front end (which can't possibly account for all of the this...
1
1829
by: beil.jp | last post by:
Hi All - I'm new to Google Groups and just a novice user of Access, so please forgive me if my question is elementary: I am having a problem using the "update query" for my first time. In my database, I have two tables. Both of the tables have duplicate data, though the "Initial Data" table has many more records than the "Filter Two" table due to a process of elimination that has occurred in the past week. Both tables have 5 colums...
9
24681
by: Joshua.Buss | last post by:
I am trying to move a record from one linked table to another within access, but I'm a complete beginner to VBA and don't know exactly where to begin. I have an access file that has the two linked tables, which each link to separate SQL databases using separate ODBC connections. I have a form that has a view of table1 and a set of buttons for manipulating the data in database1.
3
4160
by: johnds | last post by:
Another basic question from newbie. I have a 10 million record database of patient contact with their physician. The original file contained all thier clinical information and personal characteristics. Each patient record was repeated for each visit. I only want a table of unique records for each patient with their characteristics, simple enough with select distinct, but I found that I obtained duplicate records if the patient visited...
7
16255
by: Doug Bell | last post by:
Hi, I have a DataSet with a DataTable that has a number of duplicate rows (except for one column that has a unique value). Each row has OrderNo, OrderLineNo, etc and there are multiple rows with the same OrderNo and OrderLineNo. I need to display data in a DataGrid but displaying only one record for each OrderNo OrderLineNo.
0
9562
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,...
0
10542
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10309
jinu1996
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...
1
10289
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,...
0
10068
tracyyun
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...
0
6840
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5496
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...
0
5625
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2968
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.