I have some data that looks like this in an SQL table. [ID],[SettleDate],[Curr1],[Curr2][Quantity1],[Quantity2],[CashAmount1],[CashAmount2] The issue i have, i need to create 2 records from this …
Tag: sql
is there anyway to display single column data into multiple columns
I tried to do it but it was impossible for me. the solution I need to display single column data into multiple column for the current table only. e.g column [status] 3 records {present,late,absent} to display 3 columns and single row, to prevent 3 rows The result i want to display like this by grouping tid Ta…
Locating unique column values and use the output for the next query
Rails 6.0.0 ruby-2.6.2 Hello I have a model called “Group” which connects to an SQLite database. This database has two columns I’m interested in, they are hits, as an integer and iteration as an …
Storing data to SQL not working with my sql connector and scrapy
I am trying to store my scraped data with scrapy to a SQL database but my code does not send anything while no error is mentioned when runned. I am using my sql connector since I don’t manage to install MySQL-python. My SQL database seems to running well and when I run the code the traffic KB/s raise. P…
Join three count queries and get results in to three columns
I want to combine three count queries and get results in to separate columns. This is how my data set looks like. I have tried this select id, sum(val = 3) as valcount3 from (select id, s1 as val …
Group by in one table
I have list of users and a visits table . I want a list of users whose profile has been viewed : visits table ╔═════════════════╗ ║ vistor visited ║ ╠═════════════════╣ ║’26000′, ‘26023’ ║ ║’26000′, ……
How to increase performance of COUNT SQL query in PostgreSQL?
I have a table with multiply columns. But for simplicity purpose, we can consider the following table: create table tmp_table ( entity_1_id varchar(255) not null, status integer default 1 not …
Merge records that have at least one non-null element in a specific column – SQL Server
My data looks like as following: id ProteinID Gene_Name Class 10008 P08648 ITGA5 extracellular 10009 P08648 ITGA5 extracellular 10011 P08473 MME 10 NULL …
mysql error “ Operand should contain 1 column(s)” when count occurrences in multiple columns
I want to get occurrences in multiple columns and count null values as zeros. I have tried this. select IFNULL((select id, count(*) as v from ( select id, s1 as val from t1 …
SQL how to compare two fields?
Could I get a little help/direction on this? I am new to SQL and having a difficult time finding what direction to go in here. I have 2 fields I need to compare and supply an answer based on what is …