Yahoo YQL get data using sql query for different stock exchanges - yahoo-finance

hot to get nasdaq, Dow Jones,S&P 500, Nikkei 300 from yahoo apl.
select * from yahoo.finance.quotes where symbol in ("^IXIC") not work.

You have to use different tables for stock exchange...
You can use any of the 2 options below,
select * from yahoo.finance.quoteslist where symbol= '^IXIC'
OR
select * from yahoo.finance.quoteslist where symbol in ('^GSPC','^IXIC')

Related

Import Range Query not importing data

Sorry I know this question has been asked before - I have tried changing my query around but can't seem to get it to work as expected, doesn't look to be anything wrong..
I am simply trying to query data from one large master sheet into a few separate sheets. I am using importrange to get the data from sheet, and a simple select query to filter by one of the columns. If I do a select * I get all the data as expected, but can't use a WHERE clause with any column (I just need 1 of the columns, but I tried with a few different ones).
Appreciate any help!
Query:
=QUERY(IMPORTRANGE("1sNA9u2uQW-XjEKjrVS2a5LtTPCchwSuTkXfjhTJtvPk","Sheet1!B:I"),"select * WHERE 'Rank'='LTC' ")
Columns
Username Rank Time In Service TIS Time In Grade TIG Promotable Awards PLT/SQD
Source sheet: https://docs.google.com/spreadsheets/d/1sNA9u2uQW-XjEKjrVS2a5LtTPCchwSuTkXfjhTJtvPk
Test sheet: https://docs.google.com/spreadsheets/d/1UCucsfE0M4j95d_47iN0LrAhS0luv8wXVMHRVTHJHRQ
As player0 stated, you should refer to the columns by its number, you can select multiple columns and state multiple "where" statements by using Col1,Col2, etc respectively. In this case: Where Col2 = 'LTZ'
try:
=QUERY({IMPORTRANGE("1sNA9u2uQW-XjEKjrVS2a5LtTPCchwSuTkXfjhTJtvPk", "Sheet1!B:I")},
"where Col1='LTC' ", )

Google sheets query will not bring forth 3rd level filter criteria

I am using this query in google sheets to search a table on one sheet and bring forth rows containing keywords based on 2 data validated drop down menus.
=QUERY('BDDB '!$A$2:$AA,"SELECT * WHERE 1=1 "&IF(E10="All Departments",""," AND LOWER(B) = LOWER('"&E10&"')")&IF(G10="Hiring Manager",""," AND LOWER(D) = LOWER('"&G10&"')"),1)
This filter works great and I was wondering if/how I could add a third search parameter because once I add this text
&IF(I10="Priority Level",""," AND = ('"&I10&"')")
before the last ,1), the formula is error free but the third data validated drop down will not act as a filter. The 'priority level' is a numeric value rather than words so I think I may just have a basic syntax issue or a larger one if I'm jumbling up too many IF statements.
if its numeric do not use single quotes. try:
=QUERY('BDDB '!$A$2:$AA,
"WHERE 1=1 "&
IF(E10="All Departments",," AND LOWER(B) = '"&LOWER(E10)&"'")&
IF(G10="Hiring Manager",," AND LOWER(D) = '"&LOWER(G10)&"'")&
IF(I10="Priority Level",," AND I = "&I10, 1)

How to select last record in InfluxDB

I have pretty simple measurement in influxDB and have default time column and two other columns as shown below,
Select * from measurement
gives me this out put.
time component_id jkey
2016-09-27T02:49:17.837587671Z 3 "timestamp"
2016-09-27T02:49:17.849447239Z 3 "init_time"
2016-09-27T02:49:17.885999439Z 3 "ae_name"
2016-09-27T02:49:17.893056849Z 3 "init_time"
How can i select the last record of this measurement? The record which have maximum time value.
This can be done with last(). See the docs for more information: link. Or take a look at this example from the docs.
SELECT LAST("water_level") FROM "h2o_feet" WHERE "location" = 'santa_monica'
This will return the "newest" entry.

Copy from a measurement to another measurement in InfluxDB

Having the following statement:
SELECT * INTO ZZZD FROM P4978
Output:
result
time written
1970-01-01T00:00:00Z 231
Using:
SELECT * FROM ZZZD
I get only 7 lines even if there where 231 lines written. I can't figure why there are only 7 lines. Is there some setting or this is a defect? I'm not able to copy from a measurement to another measurement more than 7 lines.
If you want an exact copy use:
SELECT * INTO ZZZD FROM P4978 group by *
If you don't specify group by *, the tags will turn into fields.
You can verify the tags with show tag keys from ZZZD and the fields with show field keys from ZZZD
Source: https://docs.influxdata.com/influxdb/v1.5/query_language/continuous_queries/#common-issues-with-basic-syntax scroll to issue-4
Into clause is now working with influxDB 0.12 and above.
SELECT * INTO ZZZD FROM P4978
This will work
The INTO clause is intended for use with the downsampling continuous queries. Kapacitor is a better tool for copying data from one measurement to another.

how to get yahoo search result according to page number in YQL/pipes?

we can get only the first 10 urls result using
select url from search.web where
query="stackoverflow"
how can i get results accorridng to page numbers like result from 60 to 70, or 90 to 100 and son on..??
The answer to your question is:
SELECT url FROM search.web(0,60) WHERE query="stackoverflow"
Replace 60 with whatever other number your desire. Max is 500 afaik for the search.web YQL table because that is the limit of Yahoo BOSS which is used in this table.
You can also replace the 0 with e.g. 10, to skip the first 10 results. So using search.web(10,60) would still give you 60 results while skipping the first 10.
Also see the YQL documentation on remote limits - thats how this search.web(0,60) syntax is called.

Resources