Questions tagged [sql]

Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.

0
votes
0answers
7 views

how to get the readable result of a cross join in sqlalchemy

i am inside pdb debugger in an application built with flask, python and sqlalchemy as ORM: Assuming that we have the database: Table1: person Fields: name, age instance one: John, 34 instance two: ...
0
votes
0answers
11 views

Merge pandas dataframes and transform in SQL

I have few dataframes: DF_1 | | TYPE | SYMBOL | DESCRIPTION | OPOL | FIRST_INTEREST_DATE | |----|------|--------|-------------|------|---------------------| | 0 | BOND | 1 | FIRST | ...
0
votes
0answers
3 views

making nested query to join multiple tables

Say We have 2 tables: Table1: userid VARCHAR, segments ARRAY Table2: userid VARCHAR, gpid VARCHAR Now I want find all the gpids based on input segments and put them in another table with their ...
1
vote
1answer
7 views

Error -- SQL Compilation Error: syntax error line 1 at position 0 unexpected 'INNER'

I am trying to perform an inner join on two tables by date and county ID. Whenever I run the query, I get the following error: SQL Compilation Error: syntax error line 1 at position 0 unexpected '...
0
votes
0answers
5 views

How do you data in an sql database where a user can change the fields that are being collected

I'm trying to figure out how to store configurable a log in a database. The main issue is that the user would like to be able to update what data is being captured. Here's an example for what I'm ...
0
votes
1answer
17 views

Java SQL memory leak

I'm facing an issue where I have a java application running on a server, and it starts growing in memory until eventually the server cannot handle it anymore. This is some sort of memory leak / ...
-4
votes
0answers
14 views

Como recuperar dados do servidor usando javascript? [closed]

Como recuperar dados do servidor usando javascript????
0
votes
1answer
27 views

One to many relations how to solve issue?

I have a LocalTexts table: id(pk, autoincrement) code | lang | name 1 1 ln Aquastors 2 1 en Question Also the table RateClassificator:...
-5
votes
1answer
26 views

Can't find the solution to this [closed]

Write a query to display 10 days after today’s date in the following format: January 29, 2022 Hint: Use DUAL table. No actual database table is needed.
0
votes
0answers
34 views

converting MySQL syntax to PostgreSQL

So I designed a Bank database in MySQL, and now I want to convert some syntax to PostgreSQL this is my account and branch table : CREATE TABLE `account` ( `accountnumber` int(80) NOT NULL, `...
-1
votes
0answers
32 views

How to get average of multiple variables

Table name: products, column names: rice_price, sugar_price I would like to get the average of both columns separately. For example; SELECT AVG(rice_price) avg_rice, AVG(sugar_price) avg_sugar ...
1
vote
2answers
19 views

Finding the date before/after a date stored in int representation (Hive SQL)

I need to select between a range of dates centered on a specific date, but my partition column of dates is stored as int. For example, selecting between the dates before and after '20210901' (20210831 ...
0
votes
1answer
23 views

Get past 10 days from an event -- PostgreSQL

I have the following table: ID PatientID bpm accelerometer ... issue received 1 These are wearable sensor data that I receive every 3 ...
0
votes
0answers
10 views

Select first match from table wrt to first row given some condition and remove or ignore the pair from further matching in SQL

Suppose we have a table. Product_Id Col_1 Col_2 1 a c 2 i b 3 i b 4 i b 5 d b 6 i b 7 b a 8 e f 9 b g 10 c a 11 c a 12 h d 13 x z Now I want to ...
0
votes
2answers
29 views

SQL LEFT JOIN with WHERE and SUBSTR [duplicate]

I want to use SQL to left join two tables but only where the common column fits a substring criteria. How can this be accomplished? CREATE TABLE MY_JOIN AS SELECT A.*, B.* FROM DATA.TABLE_B AS B ...

15 30 50 per page
1
2 3 4 5
41199