Re: column names in select

2004-04-28 Thread Egor Egorov
Tom Roos [EMAIL PROTECTED] wrote:
 is it possible to suppress (i.e. not display) the column names from the resultset of 
 a
 select statement? if so, how?

For command-line mysql client use --skip-column-names (-N) option:
http://dev.mysql.com/doc/mysql/en/mysql.html



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: column names in select

2004-04-28 Thread Martijn Tonies
is it possible to suppress (i.e. not display) the column names
from the resultset of a select statement? if so, how?

What about only selecting the columns you need?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server.
Upscene Productions
http://www.upscene.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: Column names

2003-01-18 Thread Octavian Rasnita
But I know that the _ character is used as a wildcard for any single
character.
wouldn't it be considered it as a wild card when using it  in a column name?

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: Keith C. Ivey [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]
Cc: Octavian Rasnita [EMAIL PROTECTED]
Sent: Friday, January 17, 2003 8:31 PM
Subject: Re: Column names


On 17 Jan 2003, at 16:40, Octavian Rasnita wrote:

 In MySQL I know that I need to put the column names between `` in some
 cases if they contain a % or an _ sign in it. Please tell me what sign
 can I use to link 2 words in a column without needing to include that
 column name between ``.

 Can I use a - (dash) sign, or it might be considered in some cases a
 minus operator?

You shouldn't need `` around column names that contain _.  Underscore
is pretty standard for separating words in a name.

With dash, you'd have to use ``, because - is the minus operator.

[Filter fodder: SQL]

--
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Column names

2003-01-18 Thread Paul DuBois
At 15:21 +0200 1/18/03, Octavian Rasnita wrote:

But I know that the _ character is used as a wildcard for any single
character.
wouldn't it be considered it as a wild card when using it  in a column name?


Depends on the context.  If you issue a

SHOW COLUMNS FROM mytable LIKE 'my_col'

statement, then 'my_col' will match my_col, but also myxcol, my0col, etc.
You need to write it like

SHOW COLUMNS FROM mytable LIKE 'my\_col'

to match my_col *only*.

But in the context of other statements that do not interpret a name
as a pattern, _ won't be taken as a wildcard.



Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

- Original Message -
From: Keith C. Ivey [EMAIL PROTECTED]
To: MySQL [EMAIL PROTECTED]
Cc: Octavian Rasnita [EMAIL PROTECTED]
Sent: Friday, January 17, 2003 8:31 PM
Subject: Re: Column names


On 17 Jan 2003, at 16:40, Octavian Rasnita wrote:


 In MySQL I know that I need to put the column names between `` in some
 cases if they contain a % or an _ sign in it. Please tell me what sign
 can I use to link 2 words in a column without needing to include that
 column name between ``.

 Can I use a - (dash) sign, or it might be considered in some cases a
 minus operator?


You shouldn't need `` around column names that contain _.  Underscore
is pretty standard for separating words in a name.

With dash, you'd have to use ``, because - is the minus operator.

[Filter fodder: SQL]

--
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653



-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Column names

2003-01-17 Thread Jennifer Goodie
Are you creating new tables or importing from an old application?  If you
are building something from scratch it is a really really bad idea to use
spaces in the names or start putting in special characters, you're just
making more work for yourself, and anyone that works on the application
after you is going to want to strangle you :)

Using an uppercase letter to signify a new word seems to be a pretty
consistently used convention, so employeeInformation or
departmentEmployeeXref would be common (I like upper cases on the first
letter too, but that seems to not be as common).

If you are importing an old application into MySQL and need to use '-', you
must escape it with `.


-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 17, 2003 6:41 AM
To: MySQL
Subject: Column names

Hi all,

In MySQL I know that I need to put the column names between `` in some cases
if they contain a % or an _ sign in it.
Please tell me what sign can I use to link 2 words in a column without
needing to include that column name between ``.

Can I use a - (dash) sign, or it might be considered in some cases a minus
operator?

Thank you for any idea.



Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Column names

2003-01-17 Thread Keith C. Ivey
On 17 Jan 2003, at 16:40, Octavian Rasnita wrote:

 In MySQL I know that I need to put the column names between `` in some
 cases if they contain a % or an _ sign in it. Please tell me what sign
 can I use to link 2 words in a column without needing to include that
 column name between ``.
 
 Can I use a - (dash) sign, or it might be considered in some cases a
 minus operator?

You shouldn't need `` around column names that contain _.  Underscore 
is pretty standard for separating words in a name.

With dash, you'd have to use ``, because - is the minus operator.

[Filter fodder: SQL]

-- 
Keith C. Ivey [EMAIL PROTECTED]
Tobacco Documents Online
http://tobaccodocuments.org
Phone 202-667-6653

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Column names that contain %

2002-05-31 Thread Dan Nelson

In the last episode (May 31), David Adam said:
 I have a table that includes numerous column names of the form
 '%_Dry_Weight' -- that is, they start with a
 percent sign.  I am unable to query these columns, as mysql returns a
 you have an error in your SQL syntax'
 message.  When I try to escape the % character with a backslash, the
 error persists.  If I put the column name in single quotes (e.g., select
 '%_Dry_Weight' from xxx) , the syntax is accepted, but the query returns
 the column name, rather than the values stored.  According to the manual
 for 3.23.41 (which I am using),  all characters are acceptable in column
 names.  I am at an impasse - can anyone steer me in the proper
 direction?  Many thanks!

backtics:  `%_Dry_Weight`

Or use a column name like Pct_Dry_Weight :)

-- 
Dan Nelson
[EMAIL PROTECTED]

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: column names

2002-03-30 Thread Paul DuBois

At 0:06 -0600 3/31/02, Alex Behrens wrote:
Hey Guys,

What is the command to display the names of all the columns in a table?

SHOW COLUMNS FROM tbl_name;
DESCRIBE tbl_name;
EXPLAIN tbl_name;

They're described in the manual.


-mysql
Thanks!

-Alex Big Al Behrens
E-mail: [EMAIL PROTECTED]
Urgent E-mail: [EMAIL PROTECTED] (Please be brief!)
Phone: 651-482-8779
Cell: 651-329-4187
Fax: 651-482-1391
ICQ: 3969599
Owner of the 3D-Unlimited Network:
http://www.3d-unlimited.com
Send News:
[EMAIL PROTECTED]


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Column Names

2002-01-07 Thread Matthew Smith

What would

SELECT 42 FROM SOME_TABLE

return?  column name 42 or the numerical value 42 ?

M

-Original Message-
From: Sparta Cruz [mailto:[EMAIL PROTECTED]]
Sent: 07 January 2002 08:23
To: MySQL
Subject: Column Names


MySQL's Documentation:
A name may start with any character that is legal in a name. In particular,
a name may start with a number (this differs from many other database
systems!). However, a name cannot consist only of numbers.

MyQuestion:
Why can't a column name be just a number?

For example:
CREATE TABLE Odorants(

id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
odorant VARCHAR(30) NOT NULL,
row TINYINT UNSIGNED NOT NULL,

1 DOUBLE(4,20),
2 DOUBLE(4,20),
3 DOUBLE(4,20),
4 DOUBLE(4,20),
5 DOUBLE(4,20),
6 DOUBLE(4,20),
7 DOUBLE(4,20),
8 DOUBLE(4,20),
9 DOUBLE(4,20),
10 DOUBLE(4,20),
11 DOUBLE(4,20),
12 DOUBLE(4,20),
13 DOUBLE(4,20),
14 DOUBLE(4,20),
15 DOUBLE(4,20),
16 DOUBLE(4,20),
17 DOUBLE(4,20),
18 DOUBLE(4,20),
19 DOUBLE(4,20),
20 DOUBLE(4,20),
21 DOUBLE(4,20),
22 DOUBLE(4,20),
23 DOUBLE(4,20),
24 DOUBLE(4,20),
25 DOUBLE(4,20),
26 DOUBLE(4,20),
27 DOUBLE(4,20),
28 DOUBLE(4,20),
29 DOUBLE(4,20),
30 DOUBLE(4,20),
31 DOUBLE(4,20),
32 DOUBLE(4,20),
33 DOUBLE(4,20),
34 DOUBLE(4,20),
35 DOUBLE(4,20),
36 DOUBLE(4,20),
37 DOUBLE(4,20),
38 DOUBLE(4,20),
39 DOUBLE(4,20),
40 DOUBLE(4,20),
41 DOUBLE(4,20),
42 DOUBLE(4,20),
43 DOUBLE(4,20),
44 DOUBLE(4,20),
PRIMARY KEY (id),
UNIQUE UC_id (id));
ERROR 1064: You have an error in your SQL syntax near '1  DOUBLE(4,20),
2  DOUBLE(4,20),
3  DOUBLE(4,20),
4  DOUBLE(4,20),
5  DOUBLE(4,' at line 5

Other:
Any thoughts or suggestions are welcomed.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php