hi,
i have written a qurey to retive some data form a table,but i want the qurey should be more faster, i dont want to set index, other that that,if any.
advice required!!!!!
THIS THE QUREY
----------------------------
select intpurchaseqty,strCurrencyCode as Currency,intDenomination as Denomination,case
when strPrefix ='' then '0' else strprefix end as Prefix,strSrlnoFrom as From_, "
strsrlnoTo as To_ from tblfxrows where intBranchCode=5
and strInstrumenttype ='TC' and ( left(intEncashmentID,2) like 'TR%' or
(intTransferedFromID like 'IB%' and inttransactionrate = 0)) and datTransactiondate <= convert(datetime,
'05/01/5006',103) and dattransactiondate >= '05/01/2006' "
2 1323
Hi,
I can give an idea that.
1. replace like with '=' sign(like left(intEncashmentID,2) ='TR')
2. instead of case, can use isnull/replace.
3. Use '(nolock)'.
Regards,
Sharmila
hi,
i have written a qurey to retive some data form a table,but i want the qurey should be more faster, i dont want to set index, other that that,if any.
advice required!!!!!
THIS THE QUREY
----------------------------
select intpurchaseqty,strCurrencyCode as Currency,intDenomination as Denomination,case
when strPrefix ='' then '0' else strprefix end as Prefix,strSrlnoFrom as From_, "
strsrlnoTo as To_ from tblfxrows where intBranchCode=5
and strInstrumenttype ='TC' and ( left(intEncashmentID,2) like 'TR%' or
(intTransferedFromID like 'IB%' and inttransactionrate = 0)) and datTransactiondate <= convert(datetime,
'05/01/5006',103) and dattransactiondate >= '05/01/2006' "
Replace
( left(intEncashmentID,2) like 'TR%' with
LEFT(intEncashmentID,2) = 'TR'
also make sure that there is an index on that column
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Rune |
last post by:
Is it best to use double quotes and let PHP expand variables inside strings,
or is it faster to do the string manipulation yourself manually?
Which is quicker?
1)
$insert = 'To Be';...
|
by: WantedToBeDBA |
last post by:
Hi all,
db2 => create table emp(empno int not null primary key, \
db2 (cont.) => sex char(1) not null constraint s_check check \
db2 (cont.) => (sex in ('m','f')) \
db2 (cont.) => not enforced...
|
by: mjbackues at yahoo |
last post by:
Hello.
I'm having a problem with the Visual Studio .net (2003) C++ speed
optimization, and hope someone can suggest a workaround.
My project includes many C++ files, most of which work fine...
|
by: wkaras |
last post by:
I've compiled this code:
const int x0 = 10;
const int x1 = 20;
const int x2 = 30;
int x = { x2, x0, x1 };
struct Y
{
|
by: Ravikiran |
last post by:
Hi Friends,
I wanted know about whatt is ment by zero optimization and
sign optimization and its differences....
Thank you...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |