Sponsored Content
Top Forums Shell Programming and Scripting SQL select all but not if it is already in an other column Post 302395003 by lowmaster on Sunday 14th of February 2010 10:02:58 AM
Old 02-14-2010
radoulov, you are the greatest...!

I did exactly what you said. And now, on over 200.000 rows so far, this query takes about 0.01 sek now...

Compared to about a minute and more before, this is a plus, I would say.


SmilieSmilieSmilie
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Pipe SQL select statement results to script

Hello I would like to perform a select from a oracle table and return those values to my shell script For example: site=head -1 $infile | cut -c1-15 | awk '{printf "s%", $0} sqlplus -s /nolog |& #Open pipe to sql select col1, col2, col3, col4 from oracle_table where col5 =... (6 Replies)
Discussion started by: houtakker
6 Replies

2. Shell Programming and Scripting

formatting the sql select result

Hi, I have about 12 columns and 15 rows to be retrived from sybase isql command through unix. But when i output the sql into a file and see it, the formatting is going for a toss. can someone please suggest how can i get the result correctly in the output file ? Thanks, Sateesh (2 Replies)
Discussion started by: kotasateesh
2 Replies

3. Web Development

SQL Select inside Insert

I have following. . . . $userid = 2 . $query = "select username from users where userid = ".$userid.";"; . $username = $line; $data="Some Data Here"; . $query = "insert into logger (username, data) valuse ($username, $data);"; . I would like to not have 2 database calls. (3 Replies)
Discussion started by: Ikon
3 Replies

4. Shell Programming and Scripting

SQL Select and awk

Dear All , I have file1.txt contain values like the following: ---------- 23 24 25 and I have shell script which has the following : more file1.txt | awk '{print "select 'DUMP',CODE1||'|'||CODE2||'|'||CODE3 from CODE where CODE1='" $1 "';"}' > file2.sql all I need is to have the... (6 Replies)
Discussion started by: habuzahra
6 Replies

5. Shell Programming and Scripting

Select SQL Queries Option

count.sh#!/bin/ksh SQL1=`sqlplus -s usr/pwd @count.sql $1 $2 $3` SQL2=`sqlplus -s usr/pwd @selectall.sql $1 $2 $3` LIST="Count Select_All" select i in $LIST do if then echo $SQL1 elif then echo $SQL2 fi done (2 Replies)
Discussion started by: killboy
2 Replies

6. Shell Programming and Scripting

using SELECT sql statement in shell script

Hi there I have a database on a remote box and i have been using shell script to insert data into it for example, i could have a script that did this SN=123456 n=server1 m=x4140 sql="UPDATE main SET hostname='$n',model='$m' WHERE serial='$SN';" echo $sql |/usr/sfw/bin/mysql -h... (4 Replies)
Discussion started by: hcclnoodles
4 Replies

7. Programming

I'm going crazy with SQL select. Please help!

Hello people, as wrote in title I'm going crazy with a "complex" SQL select. This is the seelct: select T_ADDRESS, T_MCC,T_MNC,T_MSIN,T_IM_MNC, COUNT(*) FROM TABLETEST WHERE T_MCC=123 AND (T_MNC=11 OR T_MNC=01) GROUP BY T_ADDRESS,T_MCC,T_MNC,T_MSIN,T_IM_MNC HAVING count(*) > 5;This select... (7 Replies)
Discussion started by: Lord Spectre
7 Replies

8. Programming

[Solved] SQL SELECT REPLACE

Hi All, I had a query related to sql select update replace command. i have a table named clusters and it looks like this name model characteristics sample1.1 +123 parent sample1.2 -456 clone sample1.3 +122 ... (5 Replies)
Discussion started by: sonia102
5 Replies

9. Programming

Sql select replace

Hi All, I had a query related to sql select replace command. i have a table named clusters and it looks like this Code: name characteristics sample 1.1 parent sample 1.2 ... (2 Replies)
Discussion started by: siya@
2 Replies

10. Shell Programming and Scripting

Parse SQL text and only format first SELECT statement.

Hi Forum. Need your expertise on the following question. I have the following file which I would like to parse, find first block of SELECT statment and concatenate all input fields as 1 field (~ delimited): Old File: SELECT /*+ USE_HASH(CCOMM ICAR IMAP IAS IP IMAS IMPS IAP SPCA) */ ... (5 Replies)
Discussion started by: pchang
5 Replies
CUBRID_UNBUFFERED_QUERY(3)						 1						CUBRID_UNBUFFERED_QUERY(3)

cubrid_unbuffered_query - Perform a query without fetching the results into memory

SYNOPSIS
resource cubrid_unbuffered_query (string $query, [resource $conn_identifier]) DESCRIPTION
This function performs a query without waiting for that all query results have been complete. It will return when the results are being generated. PARAMETERS
o $query -A SQL query. o $conn_identifier -The CUBRID connection. If the connection identifier is not specified, the last connection opened by cubrid_connect(3) is assumed. RETURN VALUES
For SELECT, SHOW, DESCRIBE or EXPLAIN statements returns a request identifier resource on success. For other type of SQL statements, UPDATE, DELETE, DROP, etc, returns TRUE on success. FALSE on failure. NOTES
Note The benefits of cubrid_unbuffered_query(3) come at a cost: you cannot use cubrid_num_rows(3) and cubrid_data_seek(3) on a result set returned from cubrid_unbuffered_query(3). EXAMPLES
Example #1 cubrid_unbuffered_query(3) example <?php $link = cubrid_connect("localhost", 30000, "demodb", "dba", ""); if (!$link) { die('Could not connect.'); } $query = "select * from code"; $result = cubrid_unbuffered_query($query, $link); while ($row = cubrid_fetch($result)) { var_dump($row); } cubrid_close_request($result); cubrid_disconnect($link); ?> PHP Documentation Group CUBRID_UNBUFFERED_QUERY(3)
All times are GMT -4. The time now is 10:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy