Category "sql"

Assert Text Error, AssertionError: No text to speak

I'm working on a project that uses voice assistant to query information stored in my sql database but I keep getting this error. The voice assistant is able to

Results of group by null values are lost

I have table which has productId and productVariantId columns. |id |userId|productId|productVariantId| ---------------------------------------- |1 |1

Updating a table from data in another table and multiple matches

First time posting here, normally I am able to find an answer to my questions by searching but not this time... I have a table T1 with 2 sets of coordinates (st

SQL: Use RegEx to return multiple substrings of a specified string in column

I am querying metadata on Snowflake which contains a column of queries: select query_name from metadata query_name SELECT * FROM SYSIBM.SQLCOLUMNS SELECT * FR

Is there a way to make a "natural join" with a table having a foreign key on another table?

This is just a dummy example. In reality I have a foreign key which references a lot of more columns. That why I'm trying replace the normal join with a "natura

Need to get appropriate/expected row number in Oracle PLSQL

Getting the following output when i use the below query SELECT P.RefNum ,Ian.ID ,Ian.Date ,Igl.Name ,Ian.Comments ,ROW_NUMBER() OVER (

Add a column with a default value to an existing table in postgresql

Question: Is there a postgres query to add a new column to an existing table and to automatically populate that column for all rows of the table with a certain

#1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Please use mysql_upgrade to fix this error

I got this message when I try to run query on XAMPP in macOS #1558 - Column count of mysql.proc is wrong. Expected 21, found 20. Created with MariaDB 100108, n

Oracle DB SQL SELECT FROM a, b INNER JOIN c : is that possible?

I had a SQL SELECT dtl.ACCT_YM AS ACCT_YM, src.SRC_NAME AS SRC_NAME, ptnr.PTNR_NAME AS PTNR_NAME, info.P

MariaDB: Error Code: 1005. Can't create table Foreign key constraint is incorrectly formed"

I want to create UserRole table, but mariaDB complains with the following error: Error Code: 1005. Can't create table `testdb`.`userrole` (errno: 150 "Foreign k

How To Sum Count Result?

I have a database that will count daily total amount of customer that does or doesn't have a transactions. Customer Column is a varchar data type Here is how

How to select rows that are not in table B but they're in table A ( left join )

I'm using DB2 to develop an app, I have the tables products, price and cost, these tables store products data at this way: As you can see, for this example

How to convert hashbytes string from sql to spark equivalent

I have a process using the following select statement in sql server SELECT HASHBYTES('SHA1', CAST('4100119300' AS NVARCHAR(100))) AS StringConverted This give

Unknown column sql error while using jooq

Query: this.dslContext.select( ROLE.asterisk(), multiset( select(PERMISSION.asterisk()) .from(ROLE_P

Get only max values from table for each ID record [duplicate]

I am having table like this, where id is repeating several times. I need to get only max L1 value for each ID, so correct result from the que

SQL order of execution

I wonder how this query is executing successfully. As we know 'having' clause execute before the select one then here how alias name used in 'select' statement

Remove a piece from a string from a big database

I have a database like this and it goes on for like 2.7m more lines. Is there an SQL condition where I can remove the identifier from the titleurl in the whole

SQN Query has to return the clients of the user and the children of those clients

This is the query I have so far, which returns the customers of a user. But I need it to also return the children of these clients. SELECT c.id_client, c.uuid,

DELETE FROM + LEFT JOIN SNOWFLAKE

I'm trying to delete rows from table using delete. delete a from "table1" as a LEFT JOIN "table2" AS b on a."x" = b."x" where b."X" = 'X' but everything I ge

Unable to access data in Postgres query where clause

I am dealing with the following JSON in a Postgres database column called steps in a table called tCampaign : [ { "name":"Step 1", "stepRefe