[DUG] sql query issue
Vikas...
vikas.image at gmail.com
Thu May 8 18:21:36 NZST 2008
Hi Naven
thanskf ro the reply
please find the query below
************************************************
SELECT top 100 percent convert(varchar,a.approvedate,112) as [date],
rtrim(a.accountnumber)+replicate(' ',16-len(rtrim(a.accountnumber))) as
accountnumber,
dbo.Get_Value(accountname,100) as accountname ,
convert(varchar, convert(datetime,createdate),112) as AccountOpenDate ,
dbo.Get_Value(a.comment,1016) as OperatingIns,
dbo.Get_Value((select acctstatuscode from svs_account..acctstatus c where
c.acctstatusid=a.statusid),16) as AccountStatus ,
(rtrim(icnumber1)+replicate (' ',15-len(rtrim(icnumber1)))) as CUSTID ,
dbo.Get_Value(signaturename,100) as [CUSTID Name],
(case when (select count(*) from svs_account..signcardtable s where
s.accountnumber=b.accountnumber and s.branchnumber=b.branchnumber and
s.signcardnumber=b.signcardnumber)>=1 then
'ENABLE '
else 'DISABLE ' end)as CUSTIDstatus,
rtrim(a.imagefilename)+replicate(' ',22-len(rtrim(a.imagefilename)))as
imagefilename ,icnumber1 as CustomerID,signaturenumber ,
(rtrim(b.ICNumber1)+'.tiff')+replicate('
',22-len(rtrim(b.ICNumber1)+'.tiff')) as SignatureFile ,a.Branchnumber,
approvedate
from svs_account..account a , svs_account..signature b
where a.accountnumber=b.accountnumber and a.branchnumber=b.branchnumber
and b.icnumber1 not in (
select imagefile from legacydetailtbl)
************************************************
On 5/8/08, Neven MacEwan <neven at mwk.co.nz> wrote:
>
> Vikas
>
> Can you post the text of the query?
>
> Basic Pointers
>
> 1/ Add indexes for ther foreign keys (these can allow duplicates)
> 2/ Restrict the result set (I assume you dont want the query to return 10
> million rows)
> 3/ use ansi join syntax
>
> N
>
>
> Hi
> > I have an query related to an sql sever 200o using delphi 5. Not sure
> > if this is the right palce to ask it. Still i belive may be soemone can help
> > me in this
> > I am creating a store procedure.
> > In that i am fetching the information on the basis of join between two
> > table.
> > say table 1 and table2. Now thign is at my client place table 1 has 10
> > million records and table 2 has 15 million records.
> > Now i have done a join between these two table depending on
> > tabl1.x=table2.x and table1.y=table2.y. I have used the primary key in colum
> > x of table 1 that emans it automaticaly created a clustered idex. Now
> > problem is when i execute this query it takes more than hour to run this
> > query. Any way i can reduce the time of query using any option.i can't use
> > primary keys on table2 sicne i do have duplicate values.
> > Regards
> > Vikas
> > Solution consultant
> > NCR coorporation
> >
> > --
> > vikas
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > NZ Borland Developers Group - Delphi mailing list
> > Post: delphi at delphi.org.nz
> > Admin: http://delphi.org.nz/mailman/listinfo/delphi
> > Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> > unsubscribe
> >
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at delphi.org.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at delphi.org.nz with Subject:
> unsubscribe
>
--
vikas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20080508/33ecacc2/attachment.html
More information about the Delphi
mailing list