my situation is like this ..
i have 15 lac recors in my table..
the following query takes nine seconds to give the required output..
auc_hist_tbl has 15 lac records ... i have indexed AUC_UNI_NO ..
but still its taking time ..
can u guide where's my query going wrong..
thanks ..
Last edited by Scott; 02-12-2011 at 04:58 AM..
Reason: Code tags, PLEASE...
Dear All,
This may sound a simple query but a non technical person like me is not able to do it, So please help me out.
I m using Unix... isql
I jst wanted to do something like following
select * from xyz
where ID= xxxxxxxx (8 digit ID)
Here if i put single 8 digit ID then the... (5 Replies)
Hello there.
I've got the query like that
SELECT count(tour_id) AS cnt
FROM orders
JOIN tours
ON orders.tour_id=tours.id
GROUP BY tour_id
The result Is
cnt
1
4
2
1
1
Now i have to select all records with minimum values in field "cnt"
MySQL function min() returns only one.... (2 Replies)
I have been asked to create a shell script that accepts a number of SQL select queries as input, runs them in sequence, spools the output to an EXCEL workbook, where, each worksheet is an output of a Select statement run above.
The workbook should be in a .XLS format. If a particular select... (2 Replies)
Hi there,
I have trouble selecting record that contain one biggest value for a group of other values. I mean, this is my table:
mysql> SELECT * FROM b;
+----+------+-------+
| id | user | value |
+----+------+-------+
| 1 | 1 | 100 |
| 3 | 1 | 150 |
| 5 | 1 | 300 |
| 6... (20 Replies)
i have a table
records
------------
id | user | time | event
91 admin | 12:00 | hi
92 admin | 11:00 | hi
93 admin | 12:00 | bye
94 admin | 13:00 | bye
95 root | 12:00 | hi
96 root | 12:30 | hi
97 root | 12:56 | hi
how could i only select and display only the user and event from... (6 Replies)
hi..
i need to optimize my select query ..
my situation is like this ..
i have 15 lac recors in my table..
the following query takes nine seconds to give the required output..
SELECT max(ah.AUC_AMT),
SUBSTRING_INDEX(GROUP_CONCAT(SUBSTRING_INDEX(ah.AUC_CUS_NAME,'@',1) order by AUC_AMT... (0 Replies)
Hello
Please advise me how can I optimize my MySQL server. Or advise which way to look. Maybe someone had similar problems?
Over the past two weeks the MySQL server dropped 2 times. I began searching for ways to optimize the server.
Overall the picture like that:
There is a separate... (2 Replies)
Dear community,
I woul like to make a query to output all the users having the same IP address.
The table is somethig like:
name logged_ip
==== =========
user1 127.0.0.1
user2 127.0.0.2
user3 127.0.0.3
user4 127.0.0.1
user5 127.0.0.2
user6 127.0.0.5I used this query... (4 Replies)
Discussion started by: Lord Spectre
4 Replies
LEARN ABOUT PHP
mssql_query
MSSQL_QUERY(3)MSSQL_QUERY(3)mssql_query - Send MS SQL querySYNOPSIS
mixed mssql_query (string $query, [resource $link_identifier], [int $batch_size])
DESCRIPTION mssql_query(3) sends a query to the currently active database on the server that's associated with the specified link identifier.
PARAMETERS
o $query
- An SQL query.
o $link_identifier
- A MS SQL link identifier, returned by mssql_connect(3) or mssql_pconnect(3). If the link identifier isn't specified, the last
opened link is assumed. If no link is open, the function tries to establish a link as if mssql_connect(3) was called, and use it.
o $batch_size
- The number of records to batch in the buffer.
RETURN VALUES
Returns a MS SQL result resource on success, TRUE if no rows were returned, or FALSE on error.
EXAMPLES
Example #1
mssql_query(3) example
<?php
// Connect to MSSQL
$link = mssql_connect('KALLESPCSQLEXPRESS', 'sa', 'phpfi');
if (!$link || !mssql_select_db('php', $link)) {
die('Unable to connect or select database!');
}
// Do a simple query, select the version of
// MSSQL and print it.
$version = mssql_query('SELECT @@VERSION');
$row = mssql_fetch_array($version);
echo $row[0];
// Clean up
mssql_free_result($version);
?>
NOTES
Note
If the query returns multiple results then it is necessary to fetch all results by mssql_next_result(3) or free the results by
mssql_free_result(3) before executing next query.
SEE ALSO mssql_select_db(3), mssql_connect(3).
PHP Documentation Group MSSQL_QUERY(3)