I've been going bonkers trying to figure out what's wrong with my statement:
select Name,Symbol,LastTradePriceOnly,Open,DaysHigh,DaysLow,Volume,PercentChange,AfterH
oursChangeRealtime from yahoo.finance.quotes where Symbol in ('YHOO') OR Name like ('YHOO%')
Syntax error(s) [line 1:165 mismatched input 'like' expecting ISNOTNULL]
select Name,Symbol,LastTradePriceOnly,Open,DaysHigh,DaysLow,Volume,PercentChange,AfterH
oursChangeRealtime from yahoo.finance.quotes where Symbol in ('YHOO') OR Name like ('YHOO%')
Hi,
first of all, you should say "name like 'YHOO%'", without the brackets.
Stripping down your query, this is a statement that's working:
select Name,Symbol,LastTradePriceOnly,Open,DaysHigh,DaysLow,Volume,PercentChange,AfterH
oursChangeRealtime from yahoo.finance.quotes where symbol in ("YHOO")
Now if you replace the where-clause by the second part of your where-clause, you get this:
select Name,Symbol,LastTradePriceOnly,Open,DaysHigh,DaysLow,Volume,PercentChange,AfterH
oursChangeRealtime from yahoo.finance.quotes where Name like "YHOO%"
This query gives an error, because it lacks the required key 'symbol'. Now you can see it's quite obvious that if you combine clauses with 'OR', all of them should have the mandatory keys, because each member of the 'OR' is in fact a separate query.
Notice that following query does work, because now the clauses are combined with 'AND', and the 'name'-condition is applied as a local filter to the data that is retrieved by using the 'symbol'-condition as a remote filter:
select Name,Symbol,LastTradePriceOnly,Open,DaysHigh,DaysLow,Volume,PercentChange,AfterH
oursChangeRealtime from yahoo.finance.quotes where symbol in ("YHOO") and Name like "Yahoo%"
Also, there's a lot of case-sensitivity issues going on in this table definition...
Regards,
Vic