Is There A Way To Calculate Running SUM
I have a table (T1) consisting of 2 columns, Date and Observerd as follows:
Date Observed
4/1/07 2
4/2/07 4
4/7/07 3
4/10/07 5
4/12/07 1
4/18/07 7
4/22/07 2
and we want to write a query to create a table or a view with the following data:
Date ThreeDaySum
4/1/07 9 <-- (2+4+3)
4/2/07 12 <-- (4+3+5)
4/7/07 9 <-- (3+5+1)
4/10/07 13 <-- (5+1+7)
4/12/07 10 <-- (1+7+2)
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Calculate Age
I have the dob day, month and year of my users, in difference fields. I want to calculate the age in mysql, upto now i've been doing it with php, but it's much easily to show only people minimum age of so old or maximum age of so old when you're calculating the age in mysql rather than php. What's the best way to do it ?
Calculate Row Size
SHOW TABLE STATUS FROM your_db_name [like 'tabe_name'] Will give me average row sizes, but let's say I needed an exact size for each row. What would be the method to select the size of a specific row?
Calculate Percentage
Is there a way to calculate the percentage of a series of values in MySQL? I need to have the total of sum in order to calculate the percentage in each row. How can I do this in the following query? SELECT product.productId, product.name, COUNT(product.productId) AS count, SUM(invoice.value) AS sum FROM product, invoice WHERE product.productId=invoice.productId GROUP BY product.productId
Calculate Time
Have a table with a starttime and endtime, need a query that will tell me how much time was spent using starttime and the endtime. If the start time is 11:00 am and endtime is 1:00 pm I need the query to display that it took 2 hours.
Auto Calculate
I want to auto calculate DAYS for leave taken based on date key-in by user: For example: Start date: 15-04-2004 -- (Friday) End date: 18-04-2004 -- (Monday) Days: 3 -- (calculate automatically) From the date given above, system will automatically:- 1) Count days as 3 -- assuming working day is 15, 16 and 18 only. 2) Sunday will not be count as working day. Is this possible with MySQL(3.32) + PHP ?
Faster Way To Calculate
I'm looking for a faster way to calculate a 5-day moving average in a MySQL table. I have a database of stock prices for various different ticker symbols. I have a column that I use to store the 5-day moving average calculation, which is just the average stock price over the last 5 days. What I am presently doing is querying the entire table, and sorting by ticker (ascending), then date (ascending). Then I am simply obtaining a row of data at a time and writing the calculated moving average back into the table for that particular row. Since each row has a unique row number associated with it, I can easily write a particular value to any specific row within the table.
Calculate Records
I have a database that I want to display the current records from on my webpage. Current meaning not older than 30 days. I am currently using this: SELECT * FROM Table1 WHERE (Current= 1) ORDER BY ID DESC. Now, I half to change each record from my database manually by changing all the 1's to 0's when they become older than 30 days. I have a DATE, not a TIMESTAMP, that I could use, but I don't know how to write the SQL query that can use the DATE field and return only the records that are less than or equal to 30 days old.
Calculate Total Using MySQL Or PHP
Can someone recommend a the better of two ways of calculating a list of product totals: By using the following SQL: ######################################### # Get Product, Pricing and Taxes Amounts # ######################################### SELECT PRDS.prd_product_name, PRCS.prc_base_price as Price, TAXS.tax_tax_name as Tax, (TAXS.tax_tax_amount * PRCS.prc_base_price) as Tax_AMNT FROM lop_lists_of_products as LOPS, prd_products AS PRDS, prc_prices AS PRCS, map_prices_to_taxes AS MP2T, tax_taxes AS TAXS WHERE LOPS.prd_product_id = PRDS.prd_product_id AND LOPS.lop_list_of_products_id = 1 AND PRDS.prc_price_id = PRCS.prc_price_id AND MP2T.prc_price_id = PRDS.prc_price_id AND TAXS.tax_tax_id = MP2T.tax_tax_id; I generate the following result set: prd_product_name PriceTax Tax_AMNT test Product 1 54.9900G.S.T3.2993999262527 test Product 1 54.9900P.S.T4.3991999016702 Test Prod 2 27.5500G.S.T1.6529999630526 Test Prod 2 27.5500P.S.T2.2039999507368 As you can see the two products each have G.S.T. and P.S.T. taxes. If I want to get a total price that includes both taxes would I be better to:Use PHP get the Price and the Tax amounts and add them together? OR;Is there a way to get this total using SQL, and if so is it better to use SQL for this type of result or even though a method may exist to calculate totals (the way in which I am asking) the processing overhead is too great and PHP doing the calculation would be a better way?While I know how to perform the calculation in PHP, I don't know where to start to take the existing result set (shown above) and then perform another calculation upon it using SQL.
Calculate Time Between Records
I have been trying to do this for days and would appreciate some help! This database was designed by someone else and i have been lumped with writing some reports! I have a table that stores GPS information from vehicles. I am trying to write a report that will show a vehicles "idle time" Below is the table Structure. Field Type Date date Time time Vehicle int(11) Latitude char(11) Longitude char(12) Street char(50) Suburb char(50) Height int(11) SpeedInst int(11) SpeedMax int(11) SpeedAv int(11) SatCount int(11) SatsInView int(11) CourseInst int(11) CourseAv int(11) As you can imagine, it has ALOT of records So i wrote this query to narrow down the records where the vehicle is idle... SELECT `vehiclehistory`.`Date`, `vehiclehistory`.`Time`, `vehiclehistory`.`Vehicle`, `vehiclehistory`.`SpeedInst`, `vehiclehistory`.`Suburb`, `vehiclehistory`.`Street`, `vehiclehistory`.`Latitude`, `vehiclehistory`.`Longitude`, `vehiclehistory`.`SpeedMax`, `vehiclehistory`.`SpeedAv`, `vehiclehistory`.`CourseInst`, `vehiclehistory`.`CourseAv` FROM `vehiclehistory` WHERE `vehiclehistory`.`Vehicle` = ��' AND `vehiclehistory`.`Date`= ��-02-14' AND `vehiclehistory`.`SpeedInst` < Ƈ' AND `vehiclehistory`.`CourseAv` = `vehiclehistory`.`CourseInst` GROUP BY `vehiclehistory`.`CourseAv` ORDER BY `vehiclehistory`.`Time` ASC FINALLY! What i am trying to do is calculate the time between the records that the query displays... that will give me the idle time... Sorry for the long story but felt i should give you all the information.
How To Calculate With Time-fields?
i have a problem with sql-time-calculations. "update <tablename> set calc=start-stop" the fields "start", "stop" and "calc" are from datatype "time". after executing the sql statement most of "calc" fields contains "00:00:00" and that's is an error. i reied the same sql-statement with datetime-fields and got the same error.
Calculate Time MySQL
I have a DATETIME field with data ex.: 1.1.2007 12:00:00 and I want to get an exact calculation of time that elapsed from input till the time I run the query, so it would show me how many days, hours, minutes and seconds passed since the data was entered. I was trying something like this (see below), but had trouble with midnights. If data was entered at 23:59 , the query resulted that it was 1 day old after one minute. The same trouble was with end of months and years(I think). SELECT CONCAT(DAYOFYEAR(NOW())-DAYOFYEAR(date1),' days ', DATE_FORMAT(ADDTIME("2000-00-00 00:00:00",SEC_TO_TIME(TIME_TO_SEC(NOW())-TIME_TO_SEC(date1))), '%k hours and %i minutes')) AS time FROM time_table; I've tried SELECT NOW() - date1 AS passed FROM time_table; but I don't know how to get anything readable or user friendly from the result.
Calculate Number Of Rows
From the packet data returned from a query, where in the packet data are the bytes signifying the number of rows returned?
Calculate Time Between Records
This database was designed by someone else and i have been lumped with writing some reports! I have a table that stores GPS information from vehicles. I am trying to write a report that will show a vehicles "idle time" Below is the table Structure. Code:
Calculate The Difference Between 2 Dates
I searched here and also the MySql mans, but couldn't find my function! I don't wana simply subtract the year part of 2 different dates, but I need to subtract the whole part! Something like: "select '2000-05-07' - '1994-03-05'" And it should return "6-2-2",
Calculate Time Difference
I have a column called timeinterval which is of type datetime. I need to select the first and the second timeinterval and find the difference between them. if it is greater than 30 seconds i need to do something. how to achieve this. I tried using datediff and timediff. eg: select TIMEDIFF ('2006-10-31 11:50:31' , '2006-10-31 11:50:01') eg: select DATEDIFF ('2006-10-31 11:50:31' , '2006-10-31 11:50:01') but it is saying you have an error in sql syntax. Iam using mysql 4.1.0 version. one more thing. If the query works fine how can i check whether it is greater than 30 seconds. If suppose it is greater than one day it is going to return 1. How to check this condition also.
Calculate Datetime Data
I am using MySQL 4.0. I have a table: foo with Id, TimeStamp columns. TimeStamp is in DATETIME format. I want to retrieve all Ids with (Now - TimeStamp) > 30 days. How can I do that.
Need SQL To Calculate Difference Between Two Date/time
I need difference between two date not only in terms of day or hour or minute or second as outputted by following stmt. SQL SELECT TO_DAYS(NOW()) - TO_DAYS(��-09-16 11:45:00') AS diff_in_whole_days, ROUND((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(��-09-16 11:45:00')) / 86400, 1) AS diff_in_days, ROUND((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(��-09-16 11:45:00')) / 60 / 60, 1) AS diff_in_hours, ROUND((UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(��-09-16 11:45:00')) / 60, 1) AS diff_in_minutes, UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(��-09-16 11:45:00') AS diff_in_seconds; But I need the difference by days and the remaining hours, and remaining minutes and so on as shown below example: Difference bet 2007-09-17 15:45:14 and 2007-09-16 11:15:00 is 1day 4hr 30 min 14 sec. I need these all in sql statements for this requirement.
How To Calculate The Actual Value Of A Tables Row Length
Is there a way to calculate the actual value of the row length for a particular table? I need to issue the following ALTER TABLE command : alter table CMS_BACKUP_FILES max_rows = 200000000000 avg_row_length = x ; But I am unsure what value to specify for the parameter AVG_ROW_LENGTH.
Fiscal Year Totals - How To Calculate?
I am given the month number for the fiscal year. For exmaple, "4" indicates the fiscal year begins April 1 each year. April 2, 2005 would be Fiscal Year 2005. March 30, 2005 would be Fiscal Year 2004. With the following table structure: TABLE_A id date amount My current set up is like this, based on calendar year: PHP // get a list of years in the db $years = $dbh->getCol("SELECT DISTINCT(YEAR(r.date)) FROM table_A r ORDER BY YEAR(r.date) ASC"); foreach ($years as $s) { $yearSum = $db->getOne("SELECT SUM(r.amount) FROM table_A r WHERE YEAR(r.date) = '$s'"); //echo something here } ISSUE1: I need to calculate the total for each fiscal year. For example, April 1, 2004 - March 31, 2005. AND April 1, 2005 - March 31, 2006, and so on and so on for all years. ISSUE2: I need to calculate the total for each MONTH within each fiscal year. For example, during the fiscal year April 1, 2004 - March 31, 2005, what was January's total, Feb's total,... For each fiscal year.
How-to Calculate The Size Of 1 Million Rows?
Anyone have any tips for calculating the size of a certain number of rows in a MySQL DB? If phpMyAdmin gives my row size as 19 bytes will 1 million rows be 1 million times that size?
Date Functions, How To Calculate Last 7 Days...
Hope you guys don't mind me posting questions every other day MySQL is not my strong suit.. Q: If my table uses the DATE field, how would I go about selecting all the rows where the date is within the last 7 days?
Calculate Percentage In A Single Sql Statement
i am trying to calculate percentage of student came to computer laboratory in a single sql statement but no luck. SELECT f.facultyInitial, COUNT(*) AS TOTAL FROM attendance att INNER JOIN academic a ON att.academicNo = a.academicNo INNER JOIN program p ON a.programId = p.programId INNER JOIN faculty f ON p.facultyId = f.facultyId WHERE YEAR(att.attendanceDate) = 񟭆' GROUP BY f.facultyInitial ORDER BY f.facultyInitial alright, sql statement above will produce an output like below: facultyInitial | TOTAL --------------------- Account | 2 Civil | 1 FITQS | 3 what i want to do is, to put a percentage at the right side of the TOTAL column. facultyInitial | TOTAL | PERCENTAGE ----------------------------------- Account | 2 | Civil | 1 | FITQS | 3 | here is my example to produce a percentage but it does not work SELECT f.facultyInitial, COUNT(*) AS TOTAL, ROUND(COUNT(att.attendanceId)/TEMP.TOTAL_ROWS * 100, 2)) FROM attendance att INNER JOIN academic a ON att.academicNo = a.academicNo INNER JOIN program p ON a.programId = p.programId INNER JOIN faculty f ON p.facultyId = f.facultyId, (SELECT COUNT(*) AS TOTAL_ROWS FROM attendance TEMP WHERE YEAR(att.attendanceDate) = 񟭆') WHERE YEAR(att.attendanceDate) = 񟭆' GROUP BY f.facultyInitial ORDER BY f.facultyInitial
How To Calculate Weeks Elapsed In MySQL V4.0.25
Can anyone provide an example of the most straight-forward way to determine if a datetime field in a table is from the future, the current week, last week, or the 3 months previous in MySQL v4.0.25? The TIMESTAMPDIFF function looks promising but it's only available in v5.0. I'd like to pass something to the WHERE clause of the query.
How To Calculate The Size Of An AES_ENCRYPT() Result
what I want is to calculate the result string for an AES_ENCRYPT() function, in the mysql manula says:the result string length may be calculated as 16*(trunc(string_length/16)+1) but I dont know what value trunc has. Could any one please explainme how to calculate the max size of an 10 chars max wide password value?
How To Calculate Data Size In MySQL Tables
In PostgreSQL you can access meta-data about table names, etc. so you could write a program that will automatically scan through all the tables in a database. How do you do this with MySQL? Here's the scenerio: Want to scan through all the tables in a db, finding data that matches a specifc key value (ie. a specific user), and calculate what percentage of space (and total space) is being used by those matched (that user).
How Do I Calculate A New Value From 2 Columns Whilst Looping A Table
I have a single table and i would like to calculate two columns (imp and clicks) while looping through the results. this is what the table would look like... campaign | imp | clicks A | 200000 | 100 B | 100000 | 40 C | 50000 | 10 D | 300000 | 200 and here's what i would like to achieve with a mysql query and php. I would like to create a new column CTR% and calculate the CTR for each row by looping through the table... campaign | imp | clicks | CTR % A | 200000 | 100 | 0.05 B | 100000 | 40 | 0.04 C | 50000 | 10 | 0.02 D | 300000 | 200 | 0.06 i've tried a few things that i've read up on by googling but none really worked (based on using a while loop). now i would like to wipe the slate clean and get your suggestions on what to do??
Calculate A Moving Average And Updating A Table With It
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 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 0,10); SELECT tickerVL, AVG(totvolume) AS MA10 FROM( SELECT SUM(k.volume) AS totvolume FROM koersen k WHERE k.datum BETWEEN @hdat AND @ldat GROUP BY k.tickerVL ) AS tijdelijk The update part comes later. I'm now trying to make a subquery to get me the total volume of the last ten days. But I get a message that the subquery returns more then 1 row (more tickers I think). But I want a query that updates every MA10vol for every ticker. I know I'm doiing something wrong but what?
Auto Calculate Total DAYS For Leave, Help Please!
I want to auto calculate DAYS for leave taken based on date key-in by user: For example: Start date: 15-04-2004 -- (Friday) End date: 18-04-2004 -- (Monday) Days: 3 -- (calculate automatically) From the date given above, system will automatically:- 1) Count days as 3 -- assuming working day is 15, 16 and 18 only. 2) Sunday will not be count as working day. Is this possible with MySQL(3.32) + PHP?
Calculate Days Between Current Date And Date
I need to calculate the days between the current day and the date stored in a date column. I saw the datediff() command, but that only works with mysql 4.1.1. I am running 3.23.58. How can I do this?
Running Two SUM
SELECT SUM(nlamount WHERE nlaccount='3202' THEN 1 ELSE 0 END) AS receivables, SUM(nlamount WHERE nlaccount='3207' THEN 1 ELSE 0 END) AS receivablesvat FROM nominalledger WHERE nlcompanyid=$companyid AND nldate >= $company_end_year GROUP BY nlcompanyid I want to run this script, I basically want to add up nlamount twice, when nlaccount=3202 and nlaccount =3207 i have got te syntax wrong though in the SUM command, I have tried googling it, but there are only basic tutorials in sql outside the SUM instead of inside the SUM
Help Please Running Mysql On Os X
I am very new to mysql. I am using the sitepoint book 'Build your own Database Driven Website using PHP and MYSQL. I have installed mysql mysql-5.0.41-osx10.3-powerpc. Under preferences/mysql it indicates that the mysql server is running. When I try to access mysql through the terminal window I get a message - command not found. Or no permissions. I can go to the bin directory and list the contents - they seem to be there. I can't get past page 21/22 Post-installation setup tasks. I am also new to using the terminal window. I suspect I have missed something really basic - any suggestions on how I can get up and running would be much appreciated!
Need Some Help In Getting MySQL Set Up And Running.
I wasn't sure if someone would be able and willing to help me, but I am new to installing MySQL on a Windows 2003 server (actually .. any server), but I am installing it on a Windows 2003 server right now. I also installed a new version of PHP on the same server. Everything looks fine, but when I go to phpinfo.php I don't see anything saying MySQL. (I saw somewhere that if MySQL is installed properly, it should be displayed on the phpinfo.php page.) I am currently trying to set up and run Cerberus Help Desk, but it isn't finding the MySQL database that I installed. So, I would really appreciate it if someone could not just help me via email or postings in here, but actually by using Instant Messenger (AOL, Yahoo! or MSN) to walk me through the set up, testing, etc. so I can get things up and running properly. I was hoping that someone with more experience than I might be willing to help me in this manner.
Could Not Get MySQL Running
I went to MS-DOS to start the MySQL application by typing mysqld into the bin directory of where I installed MySQL but once I did typed the command and pressed enter this is all I got : A moment passed before I am shown the path of bin with no indication of MySQL server started. And also I have installed this as a window service.
Running Average
How can I get mysql to do a running average of a given field using dates from another column so that the average for each element is for a given time period rather than from the 5 rows next to the element?
#1064 - While Running A Doc Example
I plan to use the function ADDTIME(expr1, expr2) in an SQL request. I looked at the doc and tried the normal syntax, but I have always the following error even if I enter the example from the doc, why ? #1064 - You have an error in your SQL syntax. Even if I enter SELECT ADDTIME("1997-12-31 23:59:59.999999", "1 1:1:1.000002"); I am using MySQL under Windows 2000 using EasyPHP 1.7 (Apache 1.3.27, PHP 4.3.3, MySQL 4.0.15, PhpMyAdmin 2.5.3. )
Slow Running Sql
i am not using mysql but an unknown database system on a unix box - i have no control over the database but have purchased an odbc driver that seems very 'clunky' after using mysql - this is an sql statement question rather than a mysql tech question. if i run this: SELECT MK_01_vehicleRecords.registrationnumber, MK_01_VehicleRecords.vehiclenumber FROM MK_01_VehicleRecords WHERE (MK_01_VehicleRecords.vehiclenumber = '36176')
Running MySQL 5.0
I've just downloaded and installed 5.0 on my Pc/ win 98se. When I run the program MySQL Command Line Client, it appears to run for a second then disappears. I see the program flash open for a second and then it is gone.Complete newb needs some help.
Running Balance With Where
I am using the following query: SET @bal1=0,@bal2=0,@bal3=0,@bal4=0,@bal5=0,@bal6=0; SELECT Id, Date, FCode, Descr, Debit, @bal5 := @bal5 + DebT AS RunDeb, Credit, @bal6 := @bal6 + CreT AS RunCre, @bal2 := @bal2 + net AS RunBal, Rec FROM ( select fin_records.id, fin_records.id_production_unit as PUnit, fin_records.id_bank_account as BAcc, date_format(fin_records.fin_record_date,'%d-%m-%y') as Date, fin_accounts.fin_account_code as FCode, fin_records.fin_record_desc AS Descr, fin_records.fin_record_debit AS Debit, @bal3 := fin_records.fin_record_debit AS DebT, fin_records.fin_record_credit AS Credit, @bal4 := fin_records.fin_record_credit AS CreT, @bal1 := fin_records.fin_record_debit - fin_records.fin_record_credit AS Net, fin_records.fin_record_rec AS Rec from fin_records inner join fin_accounts on fin_accounts.id=fin_records.id_fin_account where (fin_records.id_production_unit='$up') and (fin_records.id_bank_account='$ba') and (fin_record_date between makedate(year(curdate()),1) and makedate(year(curdate()),365)) order by fin_records.fin_record_date,fin_records.id ) AS tmp; I should build another column to get RunBal2, that should include only records with Rec = 1.
Running Average
How can I get mysql to do a running average of a given field using dates from another column so that the average for each element is for a given time period rather than from the 5 rows next to the element?
Mysqld Is Not Running
cannot seem to run mysql commands, although queries seem to work well as I can make databases and view tables. Hope that makes sense. I installed mySQL 5 on Windows XP and tried to stick with the default installation options and paths. I lauch mySQL from this: ""C:Program FilesMySQLMySQL Server 5.0inmysqld", enter a password (but not a username so I'm assuming that's root user), get a mysql> prompt. So far so good. The following commands do not seem to work though: mysqladmin version mysqladmin variables Typing these commands then clicking the return key brings up the -> prompt. I've checked the processes and "mysql.exe" and "mysqld-nt.exe" are running. From a c: prompt I tried to install mysqld and was told it is already running. What am I missing here? I'm sure it is something very simple... Ultimately I need to bring in a table from a SQL dump from another system. I've tried using variations of: mysql -h host -u user -p dbname < dumpfile.sql I'm combing through the docs, but still don't have a clue.
MySQL 4.1 Running
I've been running mysql 4.1 for sometime and using phpMyAdmin (v2.6.2) to administer the databases. Using php scripts I can also update/insert etc the databases (maintained on my laptop Mac OS X Tiger). Suddenly, I can't get phpMyAdmin to load in the browser. I've also tried other MySQL GUI tools like CocoaMySQL and Navicat....they won't run either. I downloaded and installed phpMyAdmin 2.6.3-pl1 as well but no improvement. Why would mysql run but the admin apps not work?
Running MySQL From A CD-ROM?
I have used PHP and MySQL for a few years now. Just today I can across an application that had a MySQL database running locally off a CD ROM. I did not know this was posible. When the application runs it starts up the MySQL database without the user even knowing they are running it. It is pretty amazing. So I want to do the same thing. Is there any documentation on how to run MySQL locally. I would like to know how to build the database and create tables under these curcumstances.
Running 4.1 And 5.0 On Linux
Question: How can I run 4.1 and 5.0 simultaneously on linux - Suse 9.3 in particular? My goal is to do no harm to my current 4.1 setup. Can the 4.1 and 5.0 rpm's play nice together? Can I use the rcmysql commands for running multiple versions?
Running Sql Scripts
In the past I have always used phpmyadmin to access my mysql database. I am now doing something on a host that does not have php my admin. Can anyone help me either: 1. setup phpmyadmin -- I downloaded and uploaded to the server but I can't seem to get the config file correct or 2. how can I upload a sql script (creating all my tables) to the database.
Running Script
I'm jumping ship from a dead beat host - but first i'm trying the import on my own machine(osX). Exported all my data from phpMyAdmin 2.5.6. I did it in SQL format - one for the structure and one for the data - to a zip file(also tried with GZip).The file starts with comments and is being interpreted as all commnets - it seems there are no carriage returns - however when i look at it in any text editor or in mySql query browser, it's formatted correctly. I can place a carriage return after a comment line and reopen the query in the query browser and everything looks ok...until the next comment. My only thought is that it must be some kind of encoding issue - but i'm pretty lost when it comes to stuff like that.I've tried from the terminal/command line as well.
Running Balance
I have to calculate running balance in a query, I am trying this: set @fin_record_bal1=0; set @fin_record_bal2=0; select id,fin_record_debit,fin_record_credit,@fin_record_bal1:=fin_record_debit-fin_record_credit,@fin_record_bal2:=@fin_record_bal1+@fin_record_bal2 from fin_records The above doesn't work in record one
Running MySQL
I have installed mysql-3.23.54-win and it all seems to have gone OK .... now i want to run it and setup a database. I dont have an icon on the desktop and there is nothing in Start - Programs ..... start it from DOS prompt via C:> C:mysqlinmysql.exe and i get error 2003 cant connect to MySQL server on localhost <10061>
|