 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
fer Guest
|
Posted: Thu Apr 08, 2004 6:57 pm Post subject: Sql Needed |
|
|
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
|
Posted: Fri Apr 09, 2004 2:25 am Post subject: Re: Sql Needed |
|
|
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
|
Posted: Fri Apr 09, 2004 12:55 pm Post subject: Re: Sql Needed |
|
|
"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
|
Posted: Fri Apr 09, 2004 2:41 pm Post subject: Re: Sql Needed |
|
|
if you are writing stored proc,
there is no need to drop temp tables.
"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
|
Posted: Fri Apr 09, 2004 5:09 pm Post subject: Re: Sql Needed |
|
|
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.
"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
|
Posted: Sat Apr 10, 2004 1:34 pm Post subject: Re: Sql Needed |
|
|
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
|
Posted: Sat Apr 10, 2004 1:57 pm Post subject: Re: Sql Needed |
|
|
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 |
|
 |
|
|
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
|
|