I have this product_user table which has foreign key product in it. I need to group and count all of the products from that table with the same IDs and get that product name so result of the query …
Tag: mysql
SQL multi query
I need some help to do it right in one query (if it possible). (this is a theoretical example and I assume the presence of events in event_name(like registration/action etc) I have 3 colums: From this 3 columns we need to create new table with 4 new columns: Result must be looks like this: What I’ve don…
SQL Query not displaying correctly
I am running a query and the result is not showing correctly, unfortunately, I am not sure what is the problem. Would anyone be kind enough to provide some assistance please? Query; Result: Answer Your problem is that a field that you select is very big, that’s why it’s shown this way. I’d b…
Query can not be executed, or waiting too long
I am using MySQL 5.0 and working with some crowded tables. I actually want to calculate something and wrote a query like this: SELECT shuttle_payments.payment_user as user, SUM(-1 * (…
Charting the data from database and merging row with the same value
I want to create chart that read the category column in my database.. I have repeating category because its general term and i notice this. I have many “short” slice: I dont have any idea how to …
Sql reverse search for products and discounts
I have two table, one for products, and one for discounts. Discounts table look like: ID | Name | Percentage | Product Name Search Param ——————————————————-…
MYSQL : Group count specific column per user?
I want count column per specific user, using data from 3 tables. TABLE 1 (users) : SAMPLE : TABLE 2 (data) : SAMPLE : TABLE 3 (access): SAMPLE : What i tried so far : Result : I what to link it with user name alse, Desired Result : Answer Seems you need also a join for users and as
MySQL – Joins and Subqueries [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question IR…
Setting up a complex query in MySQL [closed]
Basically i have this kind of database: user: id username password name surname photo: id url upvotes user_id(foreign_key) pair: id user_id(foreign_key) photo1_id(foreign_key) photo2_id(foreign_key)…
Get least 10 values in mysql query
I have a table in mysql. Table Name is constitutive_table, it contains more than 40 columns and its type is varchar, it contains more than 25000 records. I wrote the query like this to get the 10 …