I’m creating a a workout app for a local gym, but I’m having a difficult time figuring out how to populate the workouts and exercises tables. Right now, I have a ‘Add Workout’ button that displays a …
Tag: sql
Oracle SQL – Difference between AND & OR operators
what is the difference between AND and OROperators? In the online class shows that AND displays a combination of 2 different conditions whats confusing is OR does the same thing, here is an example: …
Unfiltered data in a group by statement – SQL Server
I have created a SQL statement using group by and some filters but I received an unexpected result: ID | Product | Brand | years | Sales —+———+——-+———-+———- 1 | car | 1 …
Two results in a row with two columns and group
I am trying to mix multiple results on a single line Here the data example: TOPICS topicID state title 1 A ‘Hello’ 1 B ‘Bye’ 2 A ‘Great’ …
SQL Tree Query – WITH RECURSIVE & UNION. How to sort by a second value
I have a category table with a tree like structure (see image below). For a fast single query, I have the following SQL to get the full tree. This query result in the following table So the ordering according to path works well. But what I require is to have the order according to the column position, if the …
Best way to restoring Audit table without existing primary keys – postgres
Table A has an audit table that I need to restore a specific column from. Rows were deleted from table A, I then regenerated them and via matching on specific times (these are appointment records) I’…
get records that doesnt exists in another table
I have a temp table over a 1000 rows but for example purposes as follows #Table and then i have another table as follows (this is not a temp table) Compliance Table how do i check if the records from the temp table doesnt exists in the Compliance table per its ID and Code so from the above data i
Sql update query using When condition
The example below apply null values into the field nom for the others id, how can forbid this action so that it does not modify the already existing values and that I do not wish to modify ? Answer One way is with else: But if you just want to update the rows that match, then use WHERE: No need
Azure SQL Server Created Date
This could be the first of many questions I raise around Azure as I am currently on a mission to tidy up our Azure platform that has previously been setup by other teams. Our SQL Servers that have been setup on Azure have had no tags setup and I want to setup some new tags now on all our existing
Including a column twice in a PostgreSQL index
I’m building a PostgreSQL based work-queue as described here. My queue definition differs slightly from the concept described in the article by using a target timestamp for consumption (due_time): …