Skip to content

Tag: sql

Prisma update with relation in WHERE property

Given these schemas: How would I create a prisma SQL update for the awayinfo table if the only identifier I have would be the Name of a player and not the ID? what I tried: I try to pass something into the WHERE part as seen below: but it always gives me the Error: I got pretty desperate and even

Create CHECK constraint SQL

I hope you can help me. I would like to create a check constraint that ensure the column INKOOPBEDRAG has to be higher than PRIJS_PER_D. In the table INKOOPOVEREENKOMST.[BARCODE] it is a FK to ARTIKEL.[BARCODE]. I have created the following CHECK constraint, but I get an error: Answer I solved this using the …

String or binary data of ” would be truncated

I’m trying to resize a column down to 64 characters in length: but I get the following error: String or binary data would be truncated in table ‘dbo.consumption’, column ‘resourceGroup’. Truncated value: ”. This doesn’t make sense to me: how can you truncate nothing? …

select Unique row value in different column value in SQL

I have below table in SQL database with column ‘name’ has same value and column ‘Item’ has different values. table : Name Item A Good A Better A Best I would like achieve below result as output. Result: Name Item 1 Item 2 Item 3 A Good Better Best Answer Pivoting can done using an aggr…

How to create table from an existing table

I’m in Oracle APEX and would like to create a new table from other existing one like this: I have a column in a SONGS table that is: ARTIST NAME Another header Bad Bunny row Bad Bunny, Ozuna, Daddy Yankee row And I want this in another table: ID Artist 1 Bad Bunny 2 Ozuna 3 Daddy Yankee Also, from

select running by itself but not in subquery

Ok so I’m stuck at something and I need your help. How can this run ok: and this not? The error I get is: 00907. 00000 – “missing right parenthesis” Answer In SQL, in general, table ordering is non-deterministic and an order cannot be guaranteed. Your query: Will fetch rows from the ta…