Skip to content

Tag: mysql

Is it possible to create a SELECT for this?

I have (2) tables. match has (4) player IDs (pid1,pid2,pid3,pid4) and points for each player. (primary key match_id). player table has pid and the full name. I want to create a SQL select to full names and points for a given match. Create another SQL to select to full names and points for a given player id. C…

Invaild use of group function

I am trying to make an after insert trigger that will add the bnumber to the table available with the rack-id that has the most open slots. To get this I need to take the total number of slots – the number of instances and if there are no free slots then the insert will fail. Below is what I

Select if exists in another table, with AND condition

I haven’t found the answer to my question specifically even though there are very similar subjects on the same matter. Here is my database (MySQL) : I wish to select links where their SOURCE and TARGET exists in the urls table. I’m guessing subqueries or left join will be the answer, but I can&#82…

I want to make monthly report from SQL using 3 tables [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 I wan…

Left Join Where Clause (name matching ID from another table)

I want to the output to be the birthday, first and last name of customers who have been served by David who has the employee ID of 1. But for some reason (and it may be obvious, im only a beginner), it only outputs one row of Victor who’s c_id matches e_id (which I know the clue is somewhere there

SQL – Aggregate all EXCEPT group

Consider the following sample table from a soccer tournament (let’s call this table matches) +———-+———+————–+ | match_id | club_id | goals_scored | +———-+———+———-…