Sponsored Content
Top Forums Shell Programming and Scripting Compare data and columns script Post 302454166 by kanakaraju on Friday 17th of September 2010 09:39:36 AM
Old 09-17-2010
Compare data and columns script

Hello all,
I have below SQLs to compare data between 2 identical tables.in my database.

Can any body help me to convert this into a script
Code:
db2 "select *from TAB1  where PK IN (select PK  from  TAB2) order by BEDG_NR".

Note:
These SQL should run for any given 2 tables as input TAB1 ,TAB2 and same primary key (PK).
This is db2 database

Last edited by Scott; 09-20-2010 at 07:40 AM.. Reason: Please use code tags
kanakaraju
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare semicolon seperated data in 2 files using shell script

hello members, I have some data ( seperated by semicolon ) with close to 240 rows in a text file temp1. temp2.txt stores 204 rows of data ( seperated by semicolon ). I want to : Sort the data in both files by field1.i.e first data field in every row. compare the data in both files and print... (6 Replies)
Discussion started by: novice82
6 Replies

2. Shell Programming and Scripting

help to compare data from file using shell script to c++ program

hello ....i am new in shell script..I have one shell script which read inputs from file...and second is c++ pgm..i call my script from c++ programm..to compare file values to c++ pgm value.. our shell script is shubhi.sh #! /bin/sh while read line do echo -e"$line" done<file1 this script... (1 Reply)
Discussion started by: shubhig15
1 Replies

3. Ubuntu

How to compare two columns and fetch the common data with additional column

Dear All, I am new to this forum and please ignore my little knowledge :p I have two types of data (a subset is given below) data version 1: 439798 2 1 451209 1 2 508696 2 1 555760 2 1 582757 1 2 582889 1 2 691827... (2 Replies)
Discussion started by: evoll
2 Replies

4. UNIX for Dummies Questions & Answers

How to compare two columns and retrieve data

I am a newbie to Unix and slowly learning it. I have a large data set with 8 different columns. I want to compare two columns and retrieve data if the two columns have similar number. I have attached the example. There are two columns (S-Contig and N-Contig). I want to retrieve the data from... (7 Replies)
Discussion started by: bjorngill
7 Replies

5. Shell Programming and Scripting

script to compare two columns in a file

Dear everyone, I need any sort of shell script or perl script would do the following. I have a txt file as follows: ;Stretnumber Resident Resdient (not in file) 16 John Mary 16 Mary Parker 16 Nancy Smith 16 Mary John 18 Trey ... (5 Replies)
Discussion started by: sasharma
5 Replies

6. Shell Programming and Scripting

Awk based script to find the median of all individual columns in a data file

Hi All, I have some data like below. Step1,Param1,Param2,Param3 1,2,3,4 2,3,4,5 2,4,5,6 3,0,1,2 3,0,0,0 3,2,1,3 ........ so on Where I need to find the median(arithmetic) of each column from Param1...to..Param3 for each set of Step1 values. (Sort each specific column, if the... (5 Replies)
Discussion started by: ks_reddy
5 Replies

7. Shell Programming and Scripting

awk based script to find the average of all the columns in a data file

Hi All, I need the modification for the below mentioned code (found in one more post https://www.unix.com/shell-programming-scripting/27161-script-generate-average-values.html) to find the average values for all the columns(but for a specific rows) and print the averages side by side. I have... (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Howto compare the columns of 2 diff tables of 2 different schemas in UNIX shell script

HI All, I am new to Unix shell scripts.. Could you please post the unix shell script for for the below request., There are two different tables(sample1, sample2) in different schemas(s_schema1, s_schema2). Unix shell script to compare the columns of two different tables of two... (2 Replies)
Discussion started by: Rajkumar Gopal
2 Replies

9. Shell Programming and Scripting

Compare columns of two files and retrieve data

Hi guys, I need your help. I have two files: file1 1 3 5 file2 1,XX 2,AA 3,BB 4,CC 5,DD I would like to compare the first column and where they are equal to write that output in a new file: 1,XX 3,BB (7 Replies)
Discussion started by: apenkov
7 Replies

10. Shell Programming and Scripting

Compare 2 csv files by columns, then extract certain columns of matcing rows

Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns. I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Discussion started by: bkane3
5 Replies
database(1grass)						Grass User's Manual						  database(1grass)

GRASS GIS 6.4.2 Reference Manual
       Geographic Resources Analysis Support System, commonly referred to as GRASS, is a <a href="http://en.wikipedia.org/wiki/Geographic_informa-
       tion_system">Geographic Information System (GIS) used for geospatial data management and analysis, image processing, graphics/maps  produc-
       tion, spatial modeling, and visualization. GRASS is currently used in academic and commercial settings around the world, as well as by many
       governmental agencies and environmental consulting companies.

       This reference manual details the use of modules distributed with Geographic Resources Analysis Support System (GRASS), an open source (GNU
       GPL'ed), image processing and geographic information system (GIS).  Go back to help overview
       database commands:
	    | db.columns   | List all columns for a given table.
	    | db.connect   | Prints/sets general DB connection for current mapset and exits.
	    | db.copy	   | Copy a table.
	    | db.describe  | Describes a table in detail.
	    | db.drivers   | Lists all database drivers.
	    | db.dropcol   | Drops a column from selected attribute table
	    | db.droptable	| Drops an attribute table.
	    | db.execute   | Executes any SQL statement.
	    | db.in.ogr    | Imports attribute tables in various formats.
	    | db.login	   | Sets user/password for driver/database.
	    | db.out.ogr   | Exports attribute tables into various formats.
	    | db.select    | Selects data from attribute table (performs SQL query statement(s)).
	    | db.tables    | Lists all tables for a given database.
	    | db.test	   | Test database driver, database must exist and set by db.connect.

       Full Index
       (C) 2003-2011 GRASS Development Team

GRASS 6.4.2															  database(1grass)
All times are GMT -4. The time now is 12:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy