Second Request: Challenging Select Statement
am 07.12.2009 11:26:25 von Victor Subervi
--001636417375bb55fc047a20e328
Content-Type: text/plain; charset=ISO-8859-1
Hi;
I posted this Saturday. Perhaps it's too challenging for those who read it
to answer. I hope someone can.
I need to write a select statement that enables me to select column 'ID'
from a table where a certain value is found in an enum of a specific column.
For example...
select column_type from information_schema.columns where
table_name='products' and column_name='Categories';
will give me the column and its enumerations. How do I supply one of the
enumerations from a column 'Categories' and get the ID?
TIA,
Victor
--001636417375bb55fc047a20e328--
Re: Second Request: Challenging Select Statement
am 07.12.2009 14:08:36 von Tom Worster
On 12/7/09 5:26 AM, "Victor Subervi" wrote:
> Hi;
> I posted this Saturday. Perhaps it's too challenging for those who read it
> to answer. I hope someone can.
>
> I need to write a select statement that enables me to select column 'ID'
> from a table where a certain value is found in an enum of a specific column.
> For example...
>
> select column_type from information_schema.columns where
> table_name='products' and column_name='Categories';
>
> will give me the column and its enumerations. How do I supply one of the
> enumerations from a column 'Categories' and get the ID?
WHERE col LIKE '%val%'
i didn't answer this before not because it is "challenging". on the
contrary. i didn't answer because it is explained in the manual and on any
number of easily found web pages. when you apparently don't make an effort
to find the answer for yourself before you ask us, i don't feel much like
making the effort to answer.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org
Re: Second Request: Challenging Select Statement
am 07.12.2009 15:16:59 von Victor Subervi
--000e0cd6d1324face5047a241c94
Content-Type: text/plain; charset=ISO-8859-1
On Mon, Dec 7, 2009 at 8:08 AM, Tom Worster wrote:
> On 12/7/09 5:26 AM, "Victor Subervi" wrote:
>
> > Hi;
> > I posted this Saturday. Perhaps it's too challenging for those who read
> it
> > to answer. I hope someone can.
> >
> > I need to write a select statement that enables me to select column 'ID'
> > from a table where a certain value is found in an enum of a specific
> column.
> > For example...
> >
> > select column_type from information_schema.columns where
> > table_name='products' and column_name='Categories';
> >
> > will give me the column and its enumerations. How do I supply one of the
> > enumerations from a column 'Categories' and get the ID?
>
> WHERE col LIKE '%val%'
>
> i didn't answer this before not because it is "challenging". on the
> contrary. i didn't answer because it is explained in the manual and on any
> number of easily found web pages. when you apparently don't make an effort
> to find the answer for yourself before you ask us, i don't feel much like
> making the effort to answer.
>
I don't have the familiarity you have to see what is obvious only in
hindsight. Had it been obvious in foresight, I would indeed have googled and
not bothered the list. When one doesn't know enough to even properly
formulate the question, however, it is a different matter. Please be
understanding. Thank you.
V
--000e0cd6d1324face5047a241c94--