I’m trying to use SQL for the first time to store data in one of my projects, I’m using this tutorial as it makes the most sense to me, and to be honest I like the guys videos, and hate clicking on hundreds of bad videos before finding one I can learn from. Anyway I’m making an app where I
mysql one-to-many anti join query
Looking for help with a query for this situation: I have 3 tables. Shoe table is a unique collection of shoe models. Color table is a unique collection of colors a shoe could have. shoe_color table is …
Deadlock involving SELECT FOR UPDATE
I have transaction with several queries. First, a select rows with FOR UPDATE lock: SELECT f.source_id FROM files AS f WHERE f.component_id = $1 AND f.archived_at IS NULL FOR UPDATE Next, …
Showing results of one column into two columns
Select Participants from table will result in Participants ——- John Nancy Jem Albert Smith Daniella I want a query where the results shows Player Opponent —— ——– John Nancy Jem …
Do we have a workaround for the T-SQL CONCAT_WS function?
Do we have a workaround for the T-SQL CONCAT_WS function? This one throws an error that is not a recongized built in function name I presume this is not compatible with my version. I am currently …
Aggregate SQL query across multiple tables by grouping
I want to group the record from the multiple tables. Sample data: create table UserTable ( Id integer not null, Name varchar(12) not null ); insert into UserTable values (1, ‘A B’); insert into …
How can I build a string in SQL with various fields depending on value?
So I have several fields that may be zero or not. The fields are A,B,C,D,E. For my records returned, I want to build a string that has non-zero values. So the records returned might look like this: A=…
Recursive CTE to SUM amount column using date column as terminating condition
I have a table containing loan data including the start date, loan term (how many months the loan will last), and monthly payment. I am trying to create a recursive CTE that will return the SUM of …
join tables based on partial string sql
I have two tables: regional imd The regional contains a location column with information about cities of UK. The imd table contains a column ‘Name’ which also includes the city names. I want to …
Find function TO_DATE oracle in QGIS
In QGIS I get an error (to_date function error), can you tell me why?` If it’s impossible, what can we replace it with? TO_DATE(t.DATE_TOURNEE,’DD/MM/YYYY’) as DATE_TOURNEE