Home » SQL & PL/SQL » SQL & PL/SQL » Create Table T1 with column name "select".
icon14.gif  Create Table T1 with column name "select". [message #239806] Wed, 23 May 2007 06:15 Go to next message
rc_ashish
Messages: 39
Registered: June 2005
Location: mumbai
Member
Hello All,

I want to Create Table T1 with two column name as shown below,

T1- Table name
no-column name
select -column name

then how may do and how may i view the contents of table T1.

Please update the status.

Thanks in advance.

Ashish
Re: Create Table T1 with column name "select". [message #239807 is a reply to message #239806] Wed, 23 May 2007 06:18 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL Reference

If you'll name your column SELECT you'll enter in the twilight zone.

Regards
Michel

Re: Create Table T1 with column name "select". [message #239809 is a reply to message #239806] Wed, 23 May 2007 06:20 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Try it with double quotes around the column name. Note that this is case sensitive, you might want to do a describe of the table first.

MHE
Re: Create Table T1 with column name "select". [message #239816 is a reply to message #239806] Wed, 23 May 2007 06:29 Go to previous messageGo to next message
seeahead
Messages: 10
Registered: May 2007
Junior Member

create table t1 (no number, "select" varchar2(10));

select * from t1;
Re: Create Table T1 with column name "select". [message #239821 is a reply to message #239816] Wed, 23 May 2007 06:42 Go to previous messageGo to next message
rc_ashish
Messages: 39
Registered: June 2005
Location: mumbai
Member
Thnx for urs reply....

I want to say to view only "select" column of table T1.

Ashish
Re: Create Table T1 with column name "select". [message #239824 is a reply to message #239821] Wed, 23 May 2007 06:49 Go to previous messageGo to next message
ammishra
Messages: 179
Registered: January 2007
Location: india
Senior Member
try this one

select "select" from t1


--Yash
Re: Create Table T1 with column name "select". [message #239826 is a reply to message #239824] Wed, 23 May 2007 06:55 Go to previous messageGo to next message
rc_ashish
Messages: 39
Registered: June 2005
Location: mumbai
Member
Thanx....

I have use the same query it's showing like,

"select"
------
select
select
select
select


not contents of coulumn "select"...please update the status.


Ashish

[Updated on: Wed, 23 May 2007 06:56]

Report message to a moderator

Re: Create Table T1 with column name "select". [message #239833 is a reply to message #239826] Wed, 23 May 2007 07:01 Go to previous messageGo to next message
shanthkumaar
Messages: 156
Registered: February 2007
Location: india,chennai
Senior Member

hi,

SQL> create table test_45("select" varchar2(25));

Table created.

SQL> select "select" from test_45;

no rows selected

SQL> insert into test_45 values('hai');

1 row created.

SQL> select "select" from test_45;

select
-------------------------
hai

SQL> 


regards
shanth
Re: Create Table T1 with column name "select". [message #239858 is a reply to message #239806] Wed, 23 May 2007 08:23 Go to previous messageGo to next message
Bill B
Messages: 1484
Registered: December 2004
Senior Member
You must use double quotes around the column name "SELECT". However, I have to say that using an oracle reserved name for a column name is just plain lousy programming. EVERY piece of code that references the table will always have to use "SELECT" and if this is for a class, I guarantee that your instructor will lower your grade for doing something so silly.
Re: Create Table T1 with column name "select". [message #240087 is a reply to message #239858] Thu, 24 May 2007 01:59 Go to previous message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
If this isn't for a class, then every developer after you who works on this piece of code will curse you for making their life more difficult.

At the end of the day it's just a column name - it doesn't really matter what it's called, so pick something easier than a reserved word.
Previous Topic: Functions call other function.
Next Topic: problem with escape character
Goto Forum:
  


Current Time: Fri Dec 09 02:26:50 CST 2016

Total time taken to generate the page: 0.08643 seconds