Skip to content

Tag: sql

Access add new SQL data

I would like to add some Data in my SQL table… Thats the actual build. – table User (Saves Useraccess data with column UserId, UserForename,UserSurname, Mail) – Formular add new User My formular has 3 TextFields for UserForename, UserSurname, Mail and a button for adding the details. By clic…

How to select two values in one row?

Seems extremely basic, but I can’t find an elegant solution to it. I have two SQL tables, say one contains the users, and the other one, the cities. A third table contains the matches between the two …

Query to select between two dates without year

I am trying to update certain fields for employees whose date of joining falls in between 10 Jun and 31 Dec, irrespective of the year. I am trying using ‘Between’ Operator but it requires year to be included in the dates. Is there a way to generalise it in order to consider Day and Month excluding…

SQL sum grouped by field with all rows

I have this table: I want this result: I tried this: But get the error that subquery returns different number of rows. How can I do it? I want all the rows of sale_lines table selecting all fields and adding the sum(price) grouped by sale_id. Answer You can use window function : If you want sub-query then you…

Displaying student absent dates

Here is the table I want to display: Now I want to search by from to date and want absent date. How can I achieve this? I tried below code: i want date for which student absend Answer Basically what you need is list of possible dates between From and To

mySQL Self Join – inner join or join

quick clarification. When joining contents from the same table, must I always declare join type as INNER? For example, (on the table shown in this screenshot) When I tried to remove the keyword INNER, it was wrong. Is it because JOIN does not exist in SQL? Thanks and cheers. Answer You do want a self (inner) …