SQL

How to make age difference?

I have to print all people that are younger than 23. All I have in the table is their date of birth (YY-MM-DD). What should I write in my query ?

PostgresSql Related Query

I have a column named "activity", and I have 3 kinds of activities inside the "activity" column. 1.Completed_order, 2.viewed_page, 3.email.
Now, I want to write a query where I will get the activity_id of the first ’ema…

UNION AND GROUP BY

I want to combine UNION and GROUP BY for my purpose but when I try to GROUP BY to use function SUM, it always show error

‘Incorrect syntax near GROUP’.

Following is the code:
SELECT id, SUM(scoreqt)
FROM (SELECT masv, scoreqt FROM score…

SUM with Multiple Conditions

I’m writing a query on SQL Server and have hit a wall on cumulative sum with multiple conditions.
I need to sum all the purchases in a day made by a user, I can do it separately, sum purchases by day(Daily_Total), or sum purchases by user(…

MySQL Join with min and max date

I have two tables
profile
——–
id
name

Profile_dates
————–
id
profile_id
entry_date

The tables have 1 to many relationships
I want to get min and max entry_date for each profile like
id
name
profile_dates.first_date
profile…

Database not updating C#

I’m trying to save data from textboxes to a database, the new data appears in the grid, but it doesn’t appear in the database table. When I close the application and restart it, the data which appeared in the grid disappears. There is no e…