I changed it and now the third query return more then one row (more tickers I think). How do I accomplish that it only gives the ticker that is cuurently updated.
Excuse my English. Hope you understand what I mean.
Bauke
This one works:
SELECT @hdat:= (SELECT DISTINCT DATE_FORMAT(datum, '%Y-%m-%d') FROM koersen ORDER BY datum DESC LIMIT 0,1);
SELECT @ldat:= (SELECT DISTINCT DATE_FORMAT(datum, '%Y-%m-%d') FROM koersen ORDER BY datum DESC LIMIT 9,1);
SELECT tickerVL, MAvolume
FROM
(
SELECT k.tickerVL...
With this query I get the values I want:
SELECT @hdat:= (SELECT DISTINCT DATE_FORMAT(datum, '%Y-%m-%d') FROM koersen ORDER BY datum DESC LIMIT 0,1);
SELECT @ldat:= (SELECT DISTINCT DATE_FORMAT(datum, '%Y-%m-%d') FROM koersen ORDER BY datum DESC LIMIT 9,1);
SELECT tickerVL, MAvolume
FROM
(...
Hello Andrew,
No, I indeed need the ten records to total the volume and get the average from that. That average (MA) is the average for the last date. For the next day the avg of the ten newest date is used.
Hope you understand my English
Bauke
Hello,
I'm learning SQL and now I'm trying to update a table (koersen) with stockdata (date, ticker, open, close, volume, MA10vol).
The column MA10vol is empty and should contain the avg volume from the last ten records with the same ticker.
What I tried sofar:
SELECT @hdat:= (SELECT DISTINCT...
Hello,
I'm using this query:
LOAD DATA INFILE 'D:/Effectenbeheer/Koersen/Koersen_update.vsn'
REPLACE INTO TABLE allekoersen_2006el
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
(tickerVL,valuta,datum,open,hoog,laag,slot,volume);
to update the table...
Hello,
My problem is the following (apart from being a newbie):
I'm trying to get all my banktransactions (from csv-files from my bank) into MySQL (5.0.33). I managed to do that. Now I have to update the 'target'-base because some fields don't have the right values (ie INC should be changed to...
Thanks again!
But now I get 1271 Illegal mix of collations for operation 'Union'.
I looked it up but I don't understand it. I'm always using the same base and have never changed a collation. Working with XAMPP (latest version)and Navicat as a query and reporting tool.
Is it possible to set the...
Sorry, here it is. It's very simple because most of the work is done in producing the view.
SELECT Seizoen
, Naam
, Winstperc
FROM winnaars
WHERE Seizoen=(SELECT(MAX(w_seizoen)) FROM wedstrijden)
ORDER BY Winstperc DESC
LIMIT 3
Bauke
Hello,
Back again after several months. Played fine with SQL and most (with a little help from forummembers) went well.
I now have made a view with results of several years for all the people in the database.
I can query the view to get the three winners, sorted decending on Winstperc. The...
I have the following query. It gives me every time the most recent standings in this seisons competition.
Is there a way to update another table with the results of this query?
The code should be (I think):
UPDATE standen
SET speler = speler, jaarweek = MAX(JaarWeek), stand = Stand
SELECT...
Back again with a newbie question.
I have a table with three fields:
speler, jaarweek, stand
1,"2006-38", 1
1,"2006-39", 2
2,"2006-38", 2
2,"2006-39", 3
What I an trying to do is to get a query that gives me:
speler, 2006-38, 2006-39
1,1,2
2,2,3
I tried CASE, IF(), IF...THEN but no result I...
Sorry R937,
First reaction was a little fast and not so clear.
I tried your code and got an syntax error message with the last part of your code: ), INTERVAL -7 DAY)
I'm using MySQL 5.0.24a (XAMPP version) and I don't have a clue.
Any idea why I get this message?
Thanks
Bauke
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.