473,385 Members | 1,429 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

This is a reall simple SQL question

I have a table with the structure of something like this :
Username Varchar 255
Price Decimal 10,2

I want to use a select query to retrieve the total of all the price
fields for a specific user.

I tried:
"Select sum(price) as total from orders where username = 'XXX'"
Which works in other Databases I've used, but MySQL belches the query
back at me and tells me that it doesn't work.

How do I do this?

Jan 24 '06 #1
1 1046
"furby" <fc********@peoplepc.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
"Select sum(price) as total from orders where username = 'XXX'"
Which works in other Databases I've used, but MySQL belches the query
back at me and tells me that it doesn't work.


That looks all right to me. What exact error message do you see?

What version of MySQL are you using? What server operating system?

Is that the whole SQL query you are executing, or is it part of a subquery?

Regards,
Bill K.
Jan 24 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Trimbitas Sorin | last post by:
Hello I have a simple syntax question : What does the following line mean: 1: %checkType; ?? I know that @test="" is an array and $test="" is a simple variable. Thank you With best regards...
2
by: Kirk | last post by:
A very simple question for anyone who knows their HTML tags and attributes. Is there an atribute that I can use to hide the white space around a table which I have used to fill an entire page? ...
10
by: Randy | last post by:
I have asked a number of questions as a newbie trying to learn Access. Some folks have been very helpful with very direct and simple answers that help alot. Others give me answers with extensive...
2
by: Raskolnikow | last post by:
Hi! I have a very simple problem with itoa() or the localtime(...). Sorry, if it is too simple, I don't have a proper example. Please have a look at the comments. struct tm *systime; time_t...
2
by: Ivan Demkovitch | last post by:
Hi! I'm trying to parse RSS news feed with code as simple as possible. Simple XML: <?xml version="1.0"?> <rss version="2.0"> <channel> <item>
7
by: abcd | last post by:
I am trying to set up client machine and investigatging which .net components are missing to run aspx page. I have a simple aspx page which just has "hello world" printed.... When I request...
2
by: Allain Bøge | last post by:
It is really a simple question. Visual Basic .NET (2003) I create 2 forms (Form1 and Form2) I create a checkbox in Form1 (checkbox1) I create a checkbox in Form2 (checkbox1) I go to Form1...
0
by: Campaniço | last post by:
Hi Can anyone help me with this problem. ------------------------------ PDA Transportes.exe TypeLoadException FormTransMain::.ctor+0x2c FormTransMain::Main+0x5
5
by: zika.ondra | last post by:
Please could someone write me in which program should I start programin? I tried to write the source in notepad and than save it as *.exe file but it didn't work. Help me please, Thanks.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.