On Thu, 15 Jan 2009, Matthew Zwier wrote:

> Hi Faheem,
>
> On Thu, Jan 15, 2009 at 11:05 AM, Faheem Mitha <[email protected]> wrote:
>>
>>
>> Hi,
>>
>> The following code returns a list of tuples to python from the db,
>> corresponding to the values of the 'snpval_id' column in the table 'cell'.
>> I was wondering if there was an easy way to have it return a list of
>> values (in this case, integers) instead.
>> result = conn.execute("select snpval_id from cell where patient_chipid IN 
>> ('Duke00001_plateC_F11.CEL')").fetchall()
>> *********************************************************************************
>
> Easiest thing is probably just to use a list comprehension:
> result_ints = [row[0] for row in result]

Hi Matthew,

Yes, I'm doing that already. Just wondered if there was a way to return it 
in the right form directly.
                                                           Regards, Faheem.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to