Avatar of czechmate1976
czechmate1976Flag for United Kingdom of Great Britain and Northern Ireland

asked on 

Can someone help with a mysql query??

I have a database (of which diagram I am attaching to this question) and I can't figure out how to get a list of clinics with the total of salary paid to staff in each clinic ie. for example

1. clinic         £286000
2. clinic         £411000
3. clinic         £136000
4. clinic         £171000
DATA-DICTIONARY-FOR-TRAVEL-CLINI.gif
MySQL ServerSQL

Avatar of undefined
Last Comment
czechmate1976
ASKER CERTIFIED SOLUTION
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of czechmate1976
czechmate1976
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Brilliant! I totally fortgot the group by... Points are yours and thanks.. just one little thing: How do I format it to put the pound sign with the number (£)? Thanks a lot
Avatar of Roger Baklund
Roger Baklund
Flag of Norway image

This should output a pound sign in front of the number: concat('£',sum(stafftype_salary))
Avatar of czechmate1976
czechmate1976
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

SORRY, you are right!! and thanks again..
Avatar of czechmate1976
czechmate1976
Flag of United Kingdom of Great Britain and Northern Ireland image

ASKER

Thanks a lot! I totally forgot about the Group by... my only excuse is I am a beginner. Once again, thanks!
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo