Hi All,
happy new year.
I have a file with 4xN columns like
0.0000e+00 0.0000e+00 7.199E+07 7.123E+07 6.976E+07 6.482E+07 5.256E+07 2.523E+07
0.0000e+00 0.0000e+00 8.641E+07 8.550E+07 8.373E+07 7.780E+07 6.309E+07 3.028E+07... (8 Replies)
Hi all,
I have created a script which adding two columns and removing two columns for all files.
Filename: Cust_information_1200_201010.txt
Source Data:
"1","Cust information","123","106001","street","1-203 high street"
"1","Cust information","124","105001","street","1-203 high street"
... (0 Replies)
HI
My doubt may be basic one but I need to get it clarified..
When i use "if" condition that checks for many AND, OR logical conditions
like
if ]; then
return 0
fi
Even the if condition fails it returns as zero.. Any clue..
But if i add else condition like
if ]; ... (2 Replies)
Hi all, I know this sounds suspiciously like a homework course; but, it is not.
My goal is to take a file, and match my "ID" column to the "Date" column, if those conditions are true, add the total number of minutes worked and place it in this file, while not printing the original rows that I... (6 Replies)
My File looks like:
"|" -> Field separator
A|B|C|100|1000
D|E|F|1|2
G|H|I|0|7
D|E|F|1|2
A|B|C|10|10000
G|H|I|0|7
A|B|C|1|100
D|E|F|1|2
I need to do a SUM on Col. 5 and Col.6 by grouping on Col 1,2 & 3
My expected output is:
A|B|C|111|11100 (2 Replies)
Hi Friends,
I have a file with fields separated with comma. How to print sum of each field of the file?
Eg:
input file
1,3,6,7
2,1,2,1
0,1,1,0
I want to sum each field separately.
Output file
3,5,9,8
Thanks,
Suresh (2 Replies)
Hi,
I am a new bie i need some help with respect to shell onliner;
I have data in following format
Name FromDate UntilDate Active Changed Touched
Test 28-03-2013 28-03-2013 1 0.6667 100
Test2 28-03-2013 03-04-2013 ... (1 Reply)
Hi all,
I am kind of stuck with printing my desired output. Please help me if you know how it can work.
My input file(tab separated):
NW_0068.1 41,16 100,900
NW_0699.1 4,2,19 200,700,80
My Output file (desired):
NW_0068.1 41,16 100,900 100 - 141
NW_0068.1 41,16 100,900 ... (3 Replies)
Dear Experts,
I have input file which is comma separated, has 4 columns like below,
BRAND,COUNTRY,MODEL,COUNT
NIKE,USA,DUMMY,5
NIKE,USA,ORIGINAL,10
PUMA,FRANCE,DUMMY,20
PUMA,FRANCE,ORIGINAL,15
ADIDAS,ITALY,DUMMY,50
ADIDAS,ITALY,ORIGINAL,50
SPIKE,CHINA,DUMMY,1O
And expected output add... (2 Replies)
Discussion started by: ricky1991
2 Replies
LEARN ABOUT REDHAT
create_view
CREATE VIEW(7) SQL Commands CREATE VIEW(7)NAME
CREATE VIEW - define a new view
SYNOPSIS
CREATE [ OR REPLACE ] VIEW view [ ( column name list ) ] AS SELECT query
INPUTS
view The name (optionally schema-qualified) of a view to be created.
column name list
An optional list of names to be used for columns of the view. If given, these names override the column names that would be deduced
from the SQL query.
query An SQL query (that is, a SELECT statement) which will provide the columns and rows of the view.
Refer to SELECT [select(7)] for more information about valid arguments.
OUTPUTS
CREATE VIEW
The message returned if the view is successfully created.
ERROR: Relation 'view' already exists
This error occurs if the view specified already exists in the database.
WARNING: Attribute 'column' has an unknown type
The view will be created having a column with an unknown type if you do not specify it. For example, the following command gives a
warning:
CREATE VIEW vista AS SELECT 'Hello World'
whereas this command does not:
CREATE VIEW vista AS SELECT text 'Hello World'
DESCRIPTION
CREATE VIEW defines a view of a query. The view is not physically materialized. Instead, a query rewrite rule (an ON SELECT rule) is auto-
matically generated to support SELECT operations on views.
CREATE OR REPLACE VIEW is similar, but if a view of the same name already exists, it is replaced. You can only replace a view with a new
query that generates the identical set of columns (i.e., same column names and data types).
If a schema name is given (for example, CREATE VIEW myschema.myview ...) then the view is created in the specified schema. Otherwise it is
created in the current schema (the one at the front of the search path; see CURRENT_SCHEMA()). The view name must be distinct from the
name of any other view, table, sequence, or index in the same schema.
NOTES
Currently, views are read only: the system will not allow an insert, update, or delete on a view. You can get the effect of an updatable
view by creating rules that rewrite inserts, etc. on the view into appropriate actions on other tables. For more information see CREATE
RULE [create_rule(7)].
Use the DROP VIEW statement to drop views.
USAGE
Create a view consisting of all Comedy films:
CREATE VIEW kinds AS
SELECT *
FROM films
WHERE kind = 'Comedy';
SELECT * FROM kinds;
code | title | did | date_prod | kind | len
-------+---------------------------+-----+------------+--------+-------
UA502 | Bananas | 105 | 1971-07-13 | Comedy | 01:22
C_701 | There's a Girl in my Soup | 107 | 1970-06-11 | Comedy | 01:36
(2 rows)
COMPATIBILITY
SQL92
SQL92 specifies some additional capabilities for the CREATE VIEW statement:
CREATE VIEW view [ column [, ...] ]
AS SELECT expression [ AS colname ] [, ...]
FROM table [ WHERE condition ]
[ WITH [ CASCADE | LOCAL ] CHECK OPTION ]
The optional clauses for the full SQL92 command are:
CHECK OPTION
This option is to do with updatable views. All INSERT and UPDATE commands on the view will be checked to ensure data satisfy the
view-defining condition. If they do not, the update will be rejected.
LOCAL Check for integrity on this view.
CASCADE
Check for integrity on this view and on any dependent view. CASCADE is assumed if neither CASCADE nor LOCAL is specified.
CREATE OR REPLACE VIEW is a PostgreSQL language extension.
SQL - Language Statements 2002-11-22 CREATE VIEW(7)