BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sql Needed

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers)
View previous topic :: View next topic  
Author Message
fer
Guest





PostPosted: Thu Apr 08, 2004 6:57 pm    Post subject: Sql Needed Reply with quote



Hi

I have a table it has 3 field
code, name, amount

and wat to make a query which it will return all records in the table amount
times. Like This

1- 001 Fer 1
2- 002 Adam 1
3-003 Brian 2
4-004 Jorge 1

the result will be

001 Fer 1
002 Adam 1
003 Brian 2
003 Brian 2
004 Jorge 1


Back to top
Databank
Guest





PostPosted: Fri Apr 09, 2004 2:25 am    Post subject: Re: Sql Needed Reply with quote



1 create a temple table first.
Create table #t (code,name,amout)

2
declare @i int
set @i=0
while exists(select * from Table where amount>@i)
begin
insert into #t select * from jhdnr Table where amount>@i
set @i=@i+1

end
select * from #t order by name


Databank



"fer" <feriduntakis (AT) spyahoo (DOT) com> дÈëÏûÏ¢ÐÂÎÅ
:4075a0b0 (AT) newsgroups (DOT) borland.com...
Quote:
Hi

I have a table it has 3 field
code, name, amount

and wat to make a query which it will return all records in the table
amount
times. Like This

1- 001 Fer 1
2- 002 Adam 1
3-003 Brian 2
4-004 Jorge 1

the result will be

001 Fer 1
002 Adam 1
003 Brian 2
003 Brian 2
004 Jorge 1





Back to top
Mike Walsh
Guest





PostPosted: Fri Apr 09, 2004 12:55 pm    Post subject: Re: Sql Needed Reply with quote




"Databank" <david_wwb (AT) 163 (DOT) com> wrote

Quote:
1 create a temple table first.
Create table #t (code,name,amout)

2
declare @i int
set @i=0
while exists(select * from Table where amount>@i)
begin
insert into #t select * from jhdnr Table where amount>@i
set @i=@i+1

end
select * from #t order by name


Databank

Cute, but don't forget
3 drop temp table
drop table #t

Mike Walsh



Back to top
Gürcan YÜCEL
Guest





PostPosted: Fri Apr 09, 2004 2:41 pm    Post subject: Re: Sql Needed Reply with quote

if you are writing stored proc,
there is no need to drop temp tables.Smile
"Mike Walsh" <techs.msllib.com (AT) verizon (DOT) net> wrote

Quote:

"Databank" <david_wwb (AT) 163 (DOT) com> wrote in message
news:40760932 (AT) newsgroups (DOT) borland.com...
1 create a temple table first.
Create table #t (code,name,amout)

2
declare @i int
set @i=0
while exists(select * from Table where amount>@i)
begin
insert into #t select * from jhdnr Table where amount>@i
set @i=@i+1

end
select * from #t order by name


Databank

Cute, but don't forget
3 drop temp table
drop table #t

Mike Walsh





Back to top
Vitali Kalinin
Guest





PostPosted: Fri Apr 09, 2004 5:09 pm    Post subject: Re: Sql Needed Reply with quote

Really? It is something new, why do you think like that? "Gürcan YÜCEL"
<gyucel (AT) g-gsoft (DOT) com> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:4076b5af (AT) newsgroups (DOT) borland.com...
Quote:
if you are writing stored proc,
there is no need to drop temp tables.Smile
"Mike Walsh" <techs.msllib.com (AT) verizon (DOT) net> wrote in message
news:40769d6e$1 (AT) newsgroups (DOT) borland.com...

"Databank" <david_wwb (AT) 163 (DOT) com> wrote in message
news:40760932 (AT) newsgroups (DOT) borland.com...
1 create a temple table first.
Create table #t (code,name,amout)

2
declare @i int
set @i=0
while exists(select * from Table where amount>@i)
begin
insert into #t select * from jhdnr Table where amount>@i
set @i=@i+1

end
select * from #t order by name


Databank

Cute, but don't forget
3 drop temp table
drop table #t

Mike Walsh







Back to top
databank
Guest





PostPosted: Sat Apr 10, 2004 1:34 pm    Post subject: Re: Sql Needed Reply with quote


Hi all, I am looking for remote job now ,if you have project ,contact me pls with Email address [email]gaoyang0614 (AT) 21cn (DOT) com[/email], It is my work Email.you would also see the delphi.job newsletters .
Back to top
Bill Todd (TeamB)
Guest





PostPosted: Sat Apr 10, 2004 1:57 pm    Post subject: Re: Sql Needed Reply with quote

Cancelled for being off topic. This message belongs in the jobs
newsgroup.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (SQL Servers) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.