[Tutor] Help with a SQL Statement
Bod Soutar
bodsda at googlemail.com
Sun Nov 18 13:13:16 CET 2012
On Nov 18, 2012 11:30 AM, "Khalid Al-Ghamdi" <emailkgnow at gmail.com> wrote:
>
> Hi, I found one typo in 'Workshop&' which should be 'Workshop%' but it
still gives results containing majors with 'Customer%' and 'Warehouse%' in
them...
>
>
> On Sun, Nov 18, 2012 at 2:21 PM, Khalid Al-Ghamdi <emailkgnow at gmail.com>
wrote:
>>
>> Hi All,
>>
>> The SQL statement below doesn't return anything.. and I don't know
why... I've used the parans but still no luck. Any Suggestions?
>>
>> cur.execute("""select badge, name, stage, tc, major, package,
subject, course, sb_as from records where
>> sb_as = 0 and (subject like 'Workshop&' or subject
like 'Basic%' or subject like 'Introduction%') and
>> (major not like 'Customer%' or major not like
'Warehouse%') order by tc""")
>>
>> Thanks
>>
>
>
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
This is not a python issue, but shouldn't the last part of your where
clause be "major not like 'Customer%' and major not like 'Warehouse%'"
?
Bodsda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20121118/4a51367f/attachment.html>
More information about the Tutor
mailing list