dbTalk Databases Forums  

Want column name

comp.databases.mysql comp.databases.mysql


Discuss Want column name in the comp.databases.mysql forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
mada suresh
 
Posts: n/a

Default Want column name - 04-09-2011 , 05:40 AM






hi friends,
i want column names which has the value 1 in row.....
the may have multiple column,, if more then 1 present then i want each
names,,,, please help me,,, my table is here,,,

http://pastie.org/1775025

please can you help any one,, i tried many times,,, but i couldn't do
it,,, hence i have come here

Thank you

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

Default Re: Want column name - 04-09-2011 , 06:52 AM






On 09-04-2011 12:40, mada suresh wrote:
Quote:
hi friends,
i want column names which has the value 1 in row.....
SELECT JS_Ident,JS_Resume_Id,JS_ALL,JS_AL,JS_AK,JS_AZ,JS_ AR
FROM Table
WHERE JS_ALL+JS_AL+JS_AK+JS_AZ+JS_AR > 0;


Quote:
the may have multiple column,, if more then 1 present then i want each
names,,,, please help me,,, my table is here,,,
SELECT
JS_Ident,
JS_Resume_Id,
IF JS_ALL=1 THEN 'JS_ALL' ELSE '' END IF,
IF JS_AL=1 THEN 'JS_AL' ELSE '' END IF,
IF JS_AK=1 THEN 'JS_AK' ELSE '' END IF,
IF JS_AZ=1 THEN 'JS_AZ' ELSE '' END IF,
IF JS_AR=1 THEN 'JS_AR' ELSE '' END IF
FROM Table
WHERE JS_ALL+JS_AL+JS_AK+JS_AZ+JS_AR > 0;

Quote:
http://pastie.org/1775025

please can you help any one,, i tried many times,,, but i couldn't do
it,,, hence i have come here

Thank you



--
Luuk

Reply With Quote
  #3  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: Want column name - 04-09-2011 , 07:09 AM



On 4/9/2011 6:40 AM, mada suresh wrote:
Quote:
hi friends,
i want column names which has the value 1 in row.....
the may have multiple column,, if more then 1 present then i want each
names,,,, please help me,,, my table is here,,,

http://pastie.org/1775025

please can you help any one,, i tried many times,,, but i couldn't do
it,,, hence i have come here

Thank you

Normalize your data properly and you won't have this problem.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #4  
Old   
mada suresh
 
Posts: n/a

Default Re: Want column name - 04-09-2011 , 07:17 AM



it is possible for only low number columns ... what we do for large
number of columns

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

Default Re: Want column name - 04-09-2011 , 08:16 AM



On 09-04-2011 14:17, mada suresh wrote:
Quote:
it is possible for only low number columns ... what we do for large
number of columns
please,
learn English,
learn MySQL,
and re-ask your question in such a way that any one can understand what
you want to do .....

--
Luuk

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

Default Re: Want column name - 04-09-2011 , 08:18 AM



On 09-04-2011 15:16, Luuk wrote:
Quote:
On 09-04-2011 14:17, mada suresh wrote:
it is possible for only low number columns ... what we do for large
number of columns

please,
learn English,
learn MySQL,
and re-ask your question in such a way that any one can understand what
you want to do .....

If you give more text, and some examples of what you want to do, the
degree of English is less important..

--
Luuk

Reply With Quote
  #7  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: Want column name - 04-09-2011 , 08:34 AM



On 4/9/2011 8:17 AM, mada suresh wrote:
Quote:
it is possible for only low number columns ... what we do for large
number of columns
Normalize your database properly.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #8  
Old   
mada suresh
 
Posts: n/a

Default Re: Want column name - 04-14-2011 , 12:39 AM



then how could others replied they could understand my thoughts,, dont
behave like this

Reply With Quote
  #9  
Old   
Jerry Stuckle
 
Posts: n/a

Default Re: Want column name - 04-14-2011 , 05:08 AM



On 4/14/2011 1:39 AM, mada suresh wrote:
Quote:
then how could others replied they could understand my thoughts,, dont
behave like this

I agree with Luuk - I had a very hard time figuring out what you want to
do - and even then I was guessing.

And if you expect to get help here, don't be an anal orifice.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex (AT) attglobal (DOT) net
==================

Reply With Quote
  #10  
Old   
Sherm Pendley
 
Posts: n/a

Default Re: Want column name - 04-14-2011 , 02:23 PM



mada suresh <madudatabase (AT) gmail (DOT) com> writes:

Quote:
then how could others replied they could understand my thoughts,, dont
behave like this
What others? What replies? What thoughts? Behave like what?

Please quote the relevant parts of the message you're replying to - taken
by itself, what you said makes absolutely no sense.

sherm--

--
Sherm Pendley
<http://camelbones.sourceforge.net>
Cocoa Developer

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.