I tried using case myself as the first thing but it didn't work, I though I
need dynamic sql for that. Didn't realize it's that simple - just the column
name.

On Wed, May 11, 2011 at 9:04 PM, John <tauru...@gmail.com> wrote:

> yes, using Case worked for me too and that's exactly what I need since I
> need only today's value. Thank you so much guys! My kudos to you, Igor :)
>
>
> On Wed, May 11, 2011 at 9:02 PM, John <tauru...@gmail.com> wrote:
>
>> too much logic
>>
>>
>> On Wed, May 11, 2011 at 9:01 PM, John <tauru...@gmail.com> wrote:
>>
>>> I should have done it like that (normal referential table). But now I'm
>>> at the end of this project and too logic uses that table already. So perhaps
>>> I'll refactor some day.
>>>
>>>
>>> On Wed, May 11, 2011 at 8:56 PM, Igor Tandetnik <itandet...@mvps.org>wrote:
>>>
>>>> On 5/11/2011 8:52 PM, John wrote:
>>>> > here is the view:
>>>> >
>>>> > create view today_goal as
>>>> > select 'monday' dow, monday_goal value from user_goals
>>>> > union all
>>>> > select 'tuesday' dow, tuesday_goal value from user_goals
>>>> > union all
>>>> > select 'wednesday' dow, wednesday_goal value from user_goals
>>>> > union all
>>>> > select 'thursday' dow, thursday_goal value from user_goals
>>>> > union all
>>>> > select 'friday' dow, friday_goal value from user_goals
>>>> > union all
>>>> > select 'saturday' dow, saturday_goal value from user_goals
>>>> > union all
>>>> > select 'sunday' dow, sunday_goal value from user_goals;
>>>> >
>>>> > select dow, value from today_goal;
>>>>
>>>> I kind of wonder why you can't just set up your original table this way
>>>> to begin with, and not bother with the view.
>>>> --
>>>> Igor Tandetnik
>>>>
>>>> _______________________________________________
>>>> sqlite-users mailing list
>>>> sqlite-users@sqlite.org
>>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>>>
>>>
>>>
>>>
>>> --
>>> ~John
>>>
>>
>>
>>
>> --
>> ~John
>>
>
>
>
> --
> ~John
>



-- 
~John
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to