Category "sql"

REGEXP_EXTRACT in Impala

I am trying to figure out how to extract customer ID from string that looks loke this: {"param":"success","value":"10","level":"0","error_code":"101","customer

get the name of product with the maximum number of orders

I have 2 tables orders and product as orders has only one field (order_id) and the products have a reference to the order_id, how to get the name of product wit

Visual FoxPro 9. Set Grid.RecordSource to the result of SELECT

I have 2 grids and 2 tables. I want the second one to display elements that are related to the selected enement of first grid. This can probably be done in 2 wa

Find average and then use that value to calculate other values

I have a query with a few columns. I need to find the avg of a particular column and then use the average value to calculate other values. I am finding avg with

Nesting json_agg() inside json_agg()

I have these 2 tables tasks and subtasks with these columns: Tasks id name description Subtasks id name description task_id I'm trying to do a query that would

How can I get a React application to send SQL queries to an Oracle database and retrieve results?

Background: I need to create a web application that connects to an Oracle database hosted by my university through a VPN. The app does not have to be hosted onl

Select query where exists intersection of two list

I have one table that contains two columns: id (integer) list_colum (longtext) - contains json array (e.g. [1, 2, 3]) I want to select all records that have an

Unfindable SQLite Syntax Error

I'm trying out statements for creating a database, and after 10 entities without any issues I ran into this error Error: Near line 83: near "Transaction":

Better way to remove HTML tags in Oracle SQL

I have a comments column and the comments added to release are stored as rich text in comments column. Now i'm trying to process this data and get an human read

Can I have multiple INSERT statements following the same WITH statement [duplicate]

I am defining a new WITH statement as newStaff, and then I am taking that data and filling it into other tables. It doesn't seem to let me ref

HIVE CBO. Wrong results with Hive SQL query with MULTIPLE IN conditions in where clause

I am running one SQL query in Hive and it gives different results with CBO enabled and disabled. The results are wrong when CBO is enabled (set hive.cbo.enable=

How do I ignore null values in t-sql function?

I am doing an outer join between two market data tables. The two tables have trading volume reported differently, therefor I need to query them separately and t

MS Access 2016 decrypt field that is encrypted in linked ODBC SQL Server table

I need to encrypt SSN (nvarchar(25)) field in a SQL Server database table. Once encrypted, the Access program needs to be able to decrypt the field for user vi

How to query an Entity from a Many-to-Many realtionship dependendt on two ore more conditions in Ktor with the Kotlin Exposed Framework?

I have 3 entities: User id: Int name: String Room id: Int name: String RoomUser id: Int room_id: Int (Reference on Room.id) user_id: Int (Reference on User.i

GBQ Execute Immediate into a CTE

I am building an application/script for users that do not have write access to the database. Normally I would use Execute Immediate and save that result into a

pandas non equi join in range

I need to do 'pandas non equi join', when first table joined with second table in range. first_table EMPLOYEE_ID SALARY 100 3000.00 101 17000.00 102

Select and join returning duplicate data

I have some tables that can be accessed here and I would like to get a new table with EntryId from Entry table and ProtocolNumber from JudicialOrder table. For

sqlsrv_num_rows resule Warning: sqlsrv_num_rows() expects parameter 1 to be resource, boolean give [duplicate]

$results = sqlsrv_query($dbconn, $query2, array(), array('Scrollable' => 'static')); if (sqlsrv_num_rows($results) >= 2) { $query3 =

shortest and longest city name

Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there

SQL query returns result multiple times

I'm pretty new to SQL and am trying to join some tables in SQL. I'm using SQLite3 and Pandas and have the following table structure: User | Measuremen