Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: Baukep
  • Order by date
  1. Baukep

    Trying to calculate a moving average and updating a table with it

    The UPDATE query Bauke
  2. Baukep

    Trying to calculate a moving average and updating a table with it

    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
  3. Baukep

    Trying to calculate a moving average and updating a table with it

    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...
  4. Baukep

    Trying to calculate a moving average and updating a table with it

    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 (...
  5. Baukep

    Trying to calculate a moving average and updating a table with it

    Sorry Andrew, In my last answer I talked about the third query! You are completely right for the second! Thanks a lot! Bauke
  6. Baukep

    Trying to calculate a moving average and updating a table with it

    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
  7. Baukep

    Trying to calculate a moving average and updating a table with it

    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...
  8. Baukep

    Update problem with replace into

    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...
  9. Baukep

    UPDATE

    Thanks KarveR! I will try.
  10. Baukep

    UPDATE

    Thanks for the info! Back to the books ;-) Bauke
  11. Baukep

    UPDATE

    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...
  12. Baukep

    Query result as column name?!?

    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...
  13. Baukep

    Query result as column name?!?

    Thanks Rudy, Looks great but I get the error 1221 Incorrect usage of UNION and ORDER BY Any idea what's wrong? (I copied and pasted it) Bauke
  14. Baukep

    Query result as column name?!?

    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
  15. Baukep

    Query result as column name?!?

    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...
  16. Baukep

    Need help with crosstab qeury

    Thank you. No need to say sorry! I have put a related problem in a new thread. Thanks again! Stars are coming your way Bauke
  17. Baukep

    UPDATE problem

    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...
  18. Baukep

    Need help with crosstab qeury

    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...
  19. Baukep

    WHERE problem

    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
  20. Baukep

    WHERE problem

    Sorry, Syntax error. I copied and pasted it and I don't see it Bauke

Part and Inventory Search

Back
Top