472,995 Members | 1,547 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,995 software developers and data experts.

ADD A COLUMN IN SERTAIN POSITIONS:

I have a table FAMILY folowing columns:
SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT

I would like to add a column GENDER between columns NAME and DOB.
Is posiible wihout Droping table FAMILY?

Thank's in avance.
Leny G.

--
Message posted via DBMonster.com
http://www.dbmonster.com/Uwe/Forums....m-db2/200805/1

Jun 27 '08 #1
7 1541
lenygold via DBMonster.com wrote:
I have a table FAMILY folowing columns:
SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT

I would like to add a column GENDER between columns NAME and DOB.
Is posiible wihout Droping table FAMILY?

Thank's in avance.
Leny G.
No, columns can only be appended to a table. Still, I have to ask: why
do you care what position the column is in? It can only make a
difference to queries utilising the evil SELECT * syntax (or the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax).

If you need a column in a different position it's a lot easier to just
define a view ontop of the table which rearranges the columns, rather
than all the rigmarole associated with recreating it.
Cheers,

Dave.
Jun 27 '08 #2
>>On 5/28/2008 at 9:53 AM, in message
<67******************************@posted.plusnet >, Dave
Hughes<da**@waveform.plus.comwrote:
lenygold via DBMonster.com wrote:
>I have a table FAMILY folowing columns:
SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT

I would like to add a column GENDER between columns NAME and DOB.
Is posiible wihout Droping table FAMILY?

Thank's in avance.
Leny G.

No, columns can only be appended to a table. Still, I have to ask: why
do you care what position the column is in? It can only make a
difference to queries utilising the evil SELECT * syntax (or the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax).
Can you give an example of "the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax"?
I've never heard of it.

Thanks,
Frank
Jun 27 '08 #3
On May 28, 1:11 pm, "Frank Swarbrick" <Frank.Swarbr...@efirstbank.com>
wrote:
>On 5/28/2008 at 9:53 AM, in message

<67qdnZR2d89B4qDVnZ2dnUVZ8uWdn...@posted.plusnet >, Dave

Hughes<d...@waveform.plus.comwrote:
lenygold via DBMonster.com wrote:
I have a table FAMILY folowing columns:
SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT
I would like to add a column GENDER between columns NAME and DOB.
Is posiible wihout Droping table FAMILY?
Thank's in avance.
Leny G.
No, columns can only be appended to a table. Still, I have to ask: why
do you care what position the column is in? It can only make a
difference to queries utilising the evil SELECT * syntax (or the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax).

Can you give an example of "the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax"?
I've never heard of it.

Thanks,
Frank
An example of SELECT qualifier.* (the "T.*"):

WITH
T(C1, C2)
AS
(
VALUES
(1,1),
(1,2),
(2,1),
(2,2)
)
SELECT
T.*,
MAX(C2) OVER (PARTITION BY C1) MAX_C2_PER_C1_GRP
FROM
T;

--Jeff
Jun 27 '08 #4
On May 28, 2:17 pm, jefftyzzer <jefftyz...@sbcglobal.netwrote:
On May 28, 1:11 pm, "Frank Swarbrick" <Frank.Swarbr...@efirstbank.com>
wrote:
>>On 5/28/2008 at 9:53 AM, in message
<67qdnZR2d89B4qDVnZ2dnUVZ8uWdn...@posted.plusnet >, Dave
Hughes<d...@waveform.plus.comwrote:
lenygold via DBMonster.com wrote:
>I have a table FAMILY folowing columns:
>SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT
>I would like to add a column GENDER between columns NAME and DOB.
>Is posiible wihout Droping table FAMILY?
>Thank's in avance.
>Leny G.
No, columns can only be appended to a table. Still, I have to ask: why
do you care what position the column is in? It can only make a
difference to queries utilising the evil SELECT * syntax (or the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax).
Can you give an example of "the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax"?
I've never heard of it.
Thanks,
Frank

An example of SELECT qualifier.* (the "T.*"):

WITH
T(C1, C2)
AS
(
VALUES
(1,1),
(1,2),
(2,1),
(2,2)
)
SELECT
T.*,
MAX(C2) OVER (PARTITION BY C1) MAX_C2_PER_C1_GRP
FROM
T;

--Jeff
Or you could do something like:

SELECT
A.*,
B.C5
FROM
A JOIN B
ON
A.COL = B.COL;

--Jeff
Jun 27 '08 #5
>>On 5/28/2008 at 3:48 PM, in message
<20**********************************@s33g2000pri. googlegroups.com>,
jefftyzzer<je********@sbcglobal.netwrote:
On May 28, 2:17 pm, jefftyzzer <jefftyz...@sbcglobal.netwrote:
>On May 28, 1:11 pm, "Frank Swarbrick" <Frank.Swarbr...@efirstbank.com>
wrote:
>>On 5/28/2008 at 9:53 AM, in message
<67qdnZR2d89B4qDVnZ2dnUVZ8uWdn...@posted.plusnet >, Dave
Hughes<d...@waveform.plus.comwrote:
lenygold via DBMonster.com wrote:
>I have a table FAMILY folowing columns:
SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT
>I would like to add a column GENDER between columns NAME and DOB.
Is posiible wihout Droping table FAMILY?
>Thank's in avance.
Leny G.
No, columns can only be appended to a table. Still, I have to ask:
why
do you care what position the column is in? It can only make a
difference to queries utilising the evil SELECT * syntax (or the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax).
Can you give an example of "the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax"?
I've never heard of it.
Thanks,
Frank

An example of SELECT qualifier.* (the "T.*"):

WITH
T(C1, C2)
AS
(
VALUES
(1,1),
(1,2),
(2,1),
(2,2)
)
SELECT
T.*,
MAX(C2) OVER (PARTITION BY C1) MAX_C2_PER_C1_GRP
FROM
T;

--Jeff

Or you could do something like:

SELECT
A.*,
B.C5
FROM
A JOIN B
ON
A.COL = B.COL;
Now that I understand what it does, why is it any less evil than just '*'?

Is this now less evil?

SELECT T.* FROM T

:-)

Frank

Jun 27 '08 #6
On May 28, 4:05 pm, "Frank Swarbrick" <Frank.Swarbr...@efirstbank.com>
wrote:
>On 5/28/2008 at 3:48 PM, in message

<202e6a45-33c6-4263-8632-f0531a218...@s33g2000pri.googlegroups.com>,

jefftyzzer<jefftyz...@sbcglobal.netwrote:
On May 28, 2:17 pm, jefftyzzer <jefftyz...@sbcglobal.netwrote:
On May 28, 1:11 pm, "Frank Swarbrick" <Frank.Swarbr...@efirstbank.com>
wrote:
>>On 5/28/2008 at 9:53 AM, in message
<67qdnZR2d89B4qDVnZ2dnUVZ8uWdn...@posted.plusnet >, Dave
Hughes<d...@waveform.plus.comwrote:
lenygold via DBMonster.com wrote:
>I have a table FAMILY folowing columns:
>SSN,NAME,DOB,AGE,PL_BIRTH,MARITAL_STAT
>I would like to add a column GENDER between columns NAME and DOB.
>Is posiible wihout Droping table FAMILY?
>Thank's in avance.
>Leny G.
No, columns can only be appended to a table. Still, I have to ask:
why
do you care what position the column is in? It can only make a
difference to queries utilising the evil SELECT * syntax (or the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax).
Can you give an example of "the
slightly-less-evil-and-sometimes-genuinely-useful SELECT qualifier.*
syntax"?
I've never heard of it.
Thanks,
Frank
An example of SELECT qualifier.* (the "T.*"):
WITH
T(C1, C2)
AS
(
VALUES
(1,1),
(1,2),
(2,1),
(2,2)
)
SELECT
T.*,
MAX(C2) OVER (PARTITION BY C1) MAX_C2_PER_C1_GRP
FROM
T;
--Jeff
Or you could do something like:
SELECT
A.*,
B.C5
FROM
A JOIN B
ON
A.COL = B.COL;

Now that I understand what it does, why is it any less evil than just '*'?

Is this now less evil?

SELECT T.* FROM T

:-)

Frank
I leave the final word on the nefariousness of SELECT * to Dave, but
I'd imagine SELECT QUALIFIER.* is considered less evil than SELECT *
precisely because the former *is* qualified, i.e., it's at least a bit
more targeted than SELECT <all columns from all tables>.

--Jeff
Jun 27 '08 #7
>>On 5/30/2008 at 4:46 PM, in message
<8a******************************@posted.plusnet >, Dave
Hughes<da**@waveform.plus.comwrote:
>
Sorry for taking a while to respond to this, unfortunately this is a
complex subject, one which I suspect I'm barely qualified to be
commenting upon. Still, I'll give it a whirl...
Thank you for the very informative and interesting post. I learned quite a
few useful things from it!

Frank

Jun 27 '08 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sanjay Minni | last post by:
What is the datatype to be used for Primary Key columns for most optimised access given that - There will be a single column primary key only - The values will only be integers (but as...
6
by: Doug Baroter | last post by:
What is a good method/mechanism to swap the position of multiple columns? For instance, tblXZY has the followings columns and respective positions: tblXZY ====== xyzUUID 1 fn 2 ln 3...
3
by: Tyler Hudson | last post by:
/*Code below raises following errors: Server: Msg 245, Level 16, State 1, Line 6 Syntax error converting the varchar value 'a' to a column of data type int. */ create table #x (i integer, c...
10
by: Colleyville Alan | last post by:
I am trying to turn a short and fat (63 columns) table into one that is tall and skinny (7 columns). Basically, I am trying to create a "reverse crosstab" using a looping structure in VBA along...
0
by: Lalit Bhatia | last post by:
Hi, In Datagrid, while setting width of column through GridColumnStyles collection. width does not set to exact width that I am setting in my code. If I set width to 13, it is changed to 130 or...
6
by: Agnes | last post by:
I understand it is impossible, but still curious to know "Can I freeze several column in the datagrid, the user can only scroll the first 3 columns (not verical), for the rest of the coulumn, it is...
5
by: deekay | last post by:
I want to allow users to resize and reposition columns of a datasheet but for a prompt to be brought up and only the layout only to be saved if they select "save changes". This is the way it works...
1
by: krk77 | last post by:
Hi, I need to write a select statement where I select the columns by their positions rather than by their names. Let me know if this is possible and how? Eg. Select 1,2,3 from table (where 1...
6
by: Henry J. | last post by:
I have a composite index on two columns in a table. However, the index is not used in a query that restricts the 2nd column to a constant. If both columns are linked with columns in other join...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.