...
I have a working SQL-Query here, in which I'm using subqueries to get the needed result.
The idea behind this, is to get a list of networks which have 2 tags set in the database. Because of the way it is stored, i get a tuple for each Tag, so I get a duplicate of all networks.
The result without the subqueries:
Subqueries are evil in terms of performance. The last time I worked with this, I wrapped it in some lines of code and sorted out the duplicates.
I'm wondering if there's not a more clever alternative in plain SQL, which is not such a performance killer than the subqueries.
...
It is difficult to reproduce your test case because it is not clear as to how your data is stored in your tables.
Can you show the data in those three tables? (Maybe only for the 4 IP values in your output.)
You've shown the output without subqueries.
(a) Is the output incorrect? There do not appear to be any duplicate records in the output. The IP "1111111512" is repeated, sure, but the first record is for tag "AUTO_PROVISIONING" and the second for tag "SALES". So each tuple, as a whole, is unique. A case of duplicate records would be where you have this entire tuple:
1111111512 - 26 - AUTO_01 - AUTO_PROVISIONING
occurring more than once.
(b) Is your output *with* subqueries any different? What does your output look like with subqueries? Is that as per your expectation (but performing poorly)?
I have a script that looks for all jobs that contain a particular calendar.
Some of the calendars have '&' in them and sql freaks out when it encounters that.. is there a way around this?
I have tried:
select job_name from job where run_calendar='1&15dom'
select job_name from job... (3 Replies)
Hi ...
I am doing a switch user and then rsh and then running a sql query .
I am successfull in rsh and logging into the database , but my query doesnt run ..
Here's the command :
su - linus -c "rsh -l linus psmf ORACLE_SID=SMP;export ORACLE_SID;sqlplus... (1 Reply)
Hello Everyone,
I am looking to write a script that will run on many machines in a network at the same time. They need to write a result to a common location. I plan to use a SQLlite database as this common writing point. But the concern I have is how SQLlite will react to multiple writes that... (1 Reply)
Hi,
I am passing an argument for the script and that argument values should exist in database.
bill_period_input="'""$1""'"
bill_period=`sqlplus uname/pwd@dbname <<eof!
set verify off
set heading off
set feedback off
select bill_period from bill_period_ref where... (4 Replies)
Hi ,
I used the below script to get the sql data into csv file using unix scripting.
I m getting the output into an output file but the output file is not displayed in a separe columns .
#!/bin/ksh
export FILE_PATH=/maav/home/xyz/abc/
rm $FILE_PATH/sample.csv
sqlplus -s... (2 Replies)
Hi Everyone,
Can anyone pls help me out......with my requirement, i am struggling since 3 days. Please find the requirement below
my file contains below data
R1|Array/Network Resistor - VIP|V_RES_CLASS|V_MOUNT_FEATURE|SURFACE MOUNT|AND|8533.10.00.20|8533.10.00.20|
R1|Array/Network Resistor... (9 Replies)
I used the following code
code
select * from tablename where columnname
Instead of printing the expected output it prints all the files in the present directory since there is a "*" in the code. Is there any way to overcome the problem?
Thanks
Ananth (2 Replies)
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Hi All ,
I have tried many times am getting syntax error on 'UNION'
can anybody tell me ...
INSERT INTO table1
(
Type
, num_items
, num_letters
, total_value
)
(select
type='1',
num_items,
num_letters=count(*),
total_value=sum(letter_value)
from
table2
where
num_items = 1 (1 Reply)
Hello All,
I hope I'm posting this in the right section.
I have zero sql query writing skill, in fact, I've never done it before, but for some reason, a request came across my desk to get information from one of our databases. I have about 200 ticket numbers that have no information attached,... (8 Replies)
Discussion started by: bbbngowc
8 Replies
LEARN ABOUT DEBIAN
tag
tag(3tcl)tag(3tcl)NAME
tag - Manipulate tagged files
SYNOPSIS
tag option ?arg arg ...?
DESCRIPTION
The tag procedure provides a number of options for manipulating tagged files.
COMMANDS
tag readfile filename
Reads the file with the given filename and returns a list where each list element is a tag record, which is represented by a list of
label-value pairs, or label-value-endlabel triples.
The tag header is the first element returned.
tag writefile filename list
Takes a list in the format used internally in tcl programs for tagged data and writes it as a tagged file.
tag extract list tests
Takes a list in tagged format, and a list of conditions, and returns a new list in tagged format which contains those tag records
which match the conditions.
The tests is a list of test items, each of which is a list of the form { labelname condition matchvalue }
The conditions are
== String equals
!= String not equal
<= Less than or equal
-in Is the test value a member of the list given as the matchvalue
-contains
Does the match value contain the test value as a case insensitive substring.
-earlier
Date earlier
-later Date later - dates are in ISO format (yyyy-mm-dd [hh:mm:ss]).
-exists
Does the label exist in this record.
BUGS
tag readfile reads the whole file into memory before turning it into a list. Should be more memory efficient.
The -earlier and -later comparisons require TCL8.3
AUTHOR
John Lines (john@paladin.demon.co.uk)
July 3, 2000 tag(3tcl)