dbTalk Databases Forums  

Strange SELECT statement

microsoft.public.sqlserver.clients microsoft.public.sqlserver.clients


Discuss Strange SELECT statement in the microsoft.public.sqlserver.clients forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Deiny García Pérez
 
Posts: n/a

Default Strange SELECT statement - 02-25-2008 , 09:11 AM






Hello Everyone...

I have a particular Select statement to do... for example I want a Select
like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row (in
this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance



Reply With Quote
  #2  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM






Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #3  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #4  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #5  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #6  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #7  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #8  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #9  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
  #10  
Old   
Johnny
 
Posts: n/a

Default Re: Strange SELECT statement - 02-25-2008 , 10:23 AM



Howdy,

You're gonna have to create a calculated column and probably gonna have to
use the @@identity option.

If you give me some more information in terms of the values of the SpecialNo
column, I may be able to provide more specific help.

Cheers,

John
http://www.sisense.com
"Business Intelligence For Everybody!"


"Deiny García Pérez" <deiny (AT) nnn (DOT) com> wrote

Quote:
Hello Everyone...

I have a particular Select statement to do... for example I want a
Select like this:

Select Name, SpecialNo from emp... etc. and get result like this:

Name SpecialNo
Peter 5
John 10
Daniel 15
Bob 20

But the problem is this, I need SpecialNo to be a generated number, not a
real exixting data and also I want this number to increment in every row
(in this case is like John's SpecialNo = Peter's SpecialNo + 5 and so on)

Please, help me, thanks in advance




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.