Tamamlanmış

MySQL query - COUNT and SUM of specific tickets sold

There are 5 types of tickets in the database: general, early, pre-sale, sale, and limited. I would like a query that counts all of the ticket types for a specific user and sums the total price that each ticket type has sold, as well as when was the last time the ticket type was sold and the room with the highest sold of those total tickets.

Query:

SELECT ticket_type, sum(price), id, user_id, room_id from tickets WHERE user_id = X

SELECT count(ticket_id), created_at AS last_sold FROM tickets_sold

So result should be 5 rows total with the following data:

Ticket Type, SUM(price) as total_made, COUNT(ticket_id) as total_tickets_sold, room_id as highest_room, highest(created_at) AS last_sold_date

Beceriler: MySQL, Yazılım Mimarisi, SQL

Daha fazlasını gör: select count mysql, mysql count(if), mysql conditional count, select distinct count in mysql, display the product id for the product that has been sold the most, count of id in mysql, sql query top selling products, mysql count number of rows with same value, php mysql specific search query, cacti mysql query count, post today date database php mysql, script query domain look specific text, count mysql query tree, mysql slow query count, hired specific date query result mysql, mysql optimize count query, calendar booking start date end date database mysql, mysql blob data type java data type, vb sum specific criteria, specific concept understanding changed time

İşveren Hakkında:
( 54 değerlendirme ) Park Ridge, United States

Proje NO: #27812663

Seçilen:

oxanarvayva

Hello, I have read your requirement. I know what you want. you can use this query to do it. SELECT ticket_type, sum(price), id, user_id, room_id from tickets WHERE user_id = X group by ticket_type check it. And if it d Daha Fazla

1 gün içinde %selectedBids___i_sum_sub_4%%project_currencyDetails_sign_sub_5% USD
(8 Değerlendirme)
3.8

Bu iş için 17 freelancer ortalamada $23 teklif veriyor

nddungha

Hi, Could we discuss further in a chat? I can start working using the attached SQL files. Thanks and regards, Ha Nguyen

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(70 Değerlendirme)
7.2
mail2vimalarora

Hello, I am ready to discuss project with you. I had gone through your requirement details and based on sample data given, I had able to work on MYSQL query that you need and able to get required results as per your n Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(119 Değerlendirme)
6.1
kreativesystem91

Hello, a pleasure to greet you, my name is Alex, I would be interested in working on solving your query problem, I have immediate availability I remain attentive to your comments Greetings

$20 USD in 7 gün içinde
(44 Değerlendirme)
4.8
macrograph

Dear, in a few minutes I can make the SQL query you need, please write to me and I will do the SQL query and when finished you award me the project, I will be attentive to your confirmation to make the SQL query, best Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(14 Değerlendirme)
4.8
dawlance64

Hello Greetings, I have gone throught your project placement for query that counts all of the ticket and it matches my expertise. I am ahsan azhar, full stack developer with a working experience of 5+ years. I desig Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(15 Değerlendirme)
4.5
MiniDeveloper21

Hi There ! I am doing Software Engineering ,Having 2 years experience especially in programming (i.e. Java,C#,C++,C,Python),Code Debugging, Database connections, App development and much more. I can solve your queries Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(44 Değerlendirme)
4.6
phuclong7

Dear sir/madam! I'm a Web programming expert, with over 3 years experience dealing with CI & Laravel. I am familiar with php, javascript and mysql. I've checked your project and I am very interested in your project. W Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(10 Değerlendirme)
3.4
migrache

Hi, hybride I can do it within a few hours. Please do not hesitate to contact me so we can discuss further over chat. Looking forward to working with you again. Thanks

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(1 Yorum)
3.3
youchian521

Hi Dear, I read your description carefully. I understood what you require me to do and I am filled with confidence that I can complete your project wonderfully. I have experience over 5+ years with DataBase and etc. I Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(4 Değerlendirme)
2.8
vinodkumar7594

Hi Client, I have 3 years of experience working with SQL queries. I can help you with the task. please reach out to me on chat we can discuss further details. Thanks. Regards, Vinod

$20 USD in 2 gün içinde
(8 Değerlendirme)
2.4
IlyaIvanovvv1

Hi This is Ilya, a professional developer well versed in PHP, Mysql. I can start working right now. THanks

$20 USD in 7 gün içinde
(7 Değerlendirme)
2.4
Aanaaya

Hi there, I am professional Software Engineer (Web Designer & Developer). I understand your project description and I have some queries wanted to discuss, please come in private chat to discuss more in detail about you Daha Fazla

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
biki245

i usually work with sql query on mysql, sql server, dax, vba, x++, you name it :-) I have more than 20 years of experience in this.

$20 USD in 7 gün içinde
(0 Değerlendirme)
0.0
rjmijares

Hi, I'm not sure what you meant by "So result should be 5 rows total with the following data:". Perhaps you meant 5 queries? My understanding with the details you provided is that you will have different queries with Daha Fazla

$30 USD in 7 gün içinde
(0 Değerlendirme)
0.0
tejat91

Hi, I'm an experienced developer and can work on your project, could deliver in an hour. Let me know further details. Regards, Teja

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0
mk24md

Hello I have 7 year experience in mysql Pls share your project with me so that i can help you out.

1 gün içinde %bids___i_sum_sub_32%%project_currencyDetails_sign_sub_33% USD
(0 Değerlendirme)
0.0