All Questions
25 questions
2
votes
1
answer
105
views
Oracle | Retrieval of records from tables having One to many relationship
I have two tables which share one-to-many relationship. MY_FACT is the parent table whereas MY_RMDETAILS is the child table having multiple records for a single parent record.
Table MY_FACT:
FACT_ID
...
0
votes
3
answers
63
views
How can I combine these tables to get the correct output?
I'm starting to learn sql queries and trying to figure out some more complex ones (for me).
As I have these tables and schemas:
Customer (CustomerID, name, address, age, balance)
Director (DirectorID, ...
-1
votes
1
answer
147
views
How to inner join tables based on ManyToManyField and group by a parameter and get latest one in Django?
I have two models with ManyToManyField relationship:
class Education(models.Model):
title = models.CharField(default=None, max_length=100)
content = models.TextField(default=None)
price = ...
0
votes
1
answer
460
views
Pandas : filter column based on category and replace values from another data frame column
I have two data frames consist of 3 columns
dataframe1 has 2 columns & dataframe2 has 1 column
dataframe 1
name category
1 abc fruit
2 def animal
3 cfg nan
4 abc fruit
5 def ...
1
vote
1
answer
259
views
SQLite 5 tables, Join, Sum, GroupBy
I am desperately working on a issue and cannot resolve. I have a SQLite DB with five tables and corresponding columns:
Tab1 = {Job_ID, Company_ID, Source_ID}
Tab1_Category = {JOb_ID, CAtegory_ID}
...
-1
votes
1
answer
39
views
MYSQL: getting min value and group by from two tables [duplicate]
I have two tables:
Suppliers:
+-------+------+---------------+
| supid | prid | supplier_name |
+-------+------+---------------+
| 2 | 2 | Supplier 1 |
| 3 | 2 | Supplier 2 |
| ...
-2
votes
1
answer
97
views
GroupBy clause removing all null column values
I have written the following query wherein I am usig groupby clause on server column
select s.server, MAX(s.ipAddress) as ipAddress,
MAX(r.stacks->>"$[0].name") as stackName,
...
0
votes
1
answer
43
views
How to run an inner join query with multiple regexp values in MySql?
I have written the following query and it is working fine for a single hostname
SELECT hostname,
orderId,
CASE WHEN status = 30 THEN 'Finished' ELSE 'Error' END 'status',
CASE ...
0
votes
1
answer
49
views
How to use conditional statement in conjunction with group_concat?
I have written the following query which uses group_concat :
SELECT p.hostname AS Hostname,
GROUP_CONCAT(t2.status SEPARATOR ' :: ') AS Status,
GROUP_CONCAT(t3.error SEPARATOR ' :: ') AS Title
FROM ...
0
votes
1
answer
29
views
PHP query on joined table produces duplicates
I have looked at similar questions but I could not find any answers that worked for my specific situation so I hoped asking a new one would be of help. So I have 3 tables: posts, en, images. posts is ...
-1
votes
3
answers
718
views
How to INNER JOIN only one row from second table
I have a issue joining only one row from the second table
statement:
SELECT ART.*, EAN.*
FROM ART,EAN
WHERE ART.ARTNR = ean.unit_artnr
AND ean.typ = 'LE4';
TABLE EAN has sometimes 2 ...
0
votes
0
answers
50
views
Sum in group by with join Mysql, multiple group by
I want to find the sum by months. The result returned 0 rows of records.
Table 1: aidat
1 Messi
2 Ronaldo
3 Neymar
Table 2: aidat_hareket
12 1(messi) 200 12-12-2018
13 3 150 ...
-1
votes
2
answers
927
views
COUNT and GROUP BY min and max using INNER Join
Sorry if title is confusing, I have a table that stores a player and how long it took them to complete the map in seconds, I am trying to write a query that selects all the maps that a specific player ...
0
votes
1
answer
37
views
Using group by to return a row with max()
I am trying to get the items that their item_id exists in an array (arr_items) and have the higher num.
player_id | item_id | num | unique_number
-----------------------------------------
10 | ...
2
votes
1
answer
62
views
MYSQL deleting duplicate values from a table that fall on a particular date
I have mysql table with three fields and additional id column which is primary key
host ipaddress date
---- --------- -----
server1.abc.com 10.1.1.1 2011-10-...