Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.
I have four table and structure as below :
id amount_yearly budgetid
1 1000 ...
i'm currently learning sql and i have an issue.
I have a table named teachers, another one named students and one named workers. All of those have a key called Power
The tables look like this:...
So I have a job that I would like to have run on the first friday of a fiscal calendar. In this case, the first friday of the fiscal calendar month does not always match up with the actual calendar ...
I was running a migration to create an index, but the migration was blocked by another query. I resolved the problem after discovering that there was another query blocking my migrations; and after ...
I have 2 relational tables and I joined them, and I want it to be sorted by the same field.
posts fields: id, post, created
reposts fields: id,post_id, created
Here's what I currently have:
newcommand = "select cr.*, c.* from " + parsedValues + " cr join countryregioncurrency crc on cr....
I am unsure of the main issue here and believe my code is correct but I do not know how to fix the issue provided being "ORA-00979: not a GROUP BY expression".
SELECT distinct customer_city, ...
I have a bunch of large datasets.
DS_1 (contains all unique IDs and names):
1 Apple detail
1 Apple detail
1 Apple detail
Im having difficulty figuring out how to limit the correct part of my query results. Basically I am attempting to get all users that fit a criteria as well as the current user.
My code for this is:
The query below is showing some duplicate and wrong values:
SELECT c.contest_id, c.hacker_id, c.name,
SUM(s.total_submissions) as total_submissions,
SUM(s.total_accepted_submissions) as ...
In my SQL course I'm trying to answer a problem in which i'm being asked to find X% of a Total then subtracting that result from the original total to produce another result. Then putting these ...
For reference, I am using Postgres 9.2.23.
I have several tables where one table (user_group) is related to some other tables (eg: posts, group_invites, and some more other ones). There is, also a ...
It is my first time using Access and I am struggling to combine two tables. I am working on patient referrals and for each patient, there's a referral date and a discharge date. I would like to ...
I have a table called packets in Redshift. I want to create a temp table called tmp_packet_size as part of the session and generate analytics. However, I am getting the output ResultSet returned ...
I have an Access DB where its date is given in ddMMMyyyy (ex: 27SEP2020). Each time I try and set the data type as a date, it deletes the entire column of over 450 entries.
Is there a way to either ...