hello i have a program linked with mysql server remotly i want to know devices connected number ?
SQL query to add column values
TABLE T1 Name ID AMAN 10 JIM 11 SAM 12 TABLE T2 VAL ID A00 10 B0 11 The result I want: T3 Name ID VAL AMAN 10 A00 JIM 11 B0 SAM 12 NA How can I write this query? Answer
Update data to SQL Server with While java
So i’m trying to input data into my sql server with condition, i printout the value and nothing is wrong with the method, but the prepare statement only add one same data to the table, here is my code …
Join 2 parquet files with different columns but common key(id) column in Athena
I’m wondering is there a way in AWS Athena to “merge” 2 parquet files into a one single table in Athena just leveraging the columnar model of parquet, meaning without do any joins or post-…
How to add a minutes column to date column sql
I may sound silly asking it – but I have the need to add a value derived from one column of database to the other which is the date. Following is the image of data I have – timeelapsed/60000 gives me the duration of task in minutes and I would require the same to be deducted from the lastupdatedti…
Finding out information from two tables – SQL
everyone! I’m at the point of my SQL learning where I’m having a hard time trying to search to explain what I’m trying to do with SQL but here’s what I got. I have two tables. Let’s call the first one: And the second one: What I’m trying to do is get all account names and t…
Error when SQL Server grand total comes out on first row instead of at table end
The following query gets row and column totals. When I add ORDER BY, the column total appears in the first row instead of the bottom row. What could be your suggested solution? Answer you can use grouping which returns 1 if the column is part of aggregation and you can use it in your order by:
Microsoft SQL Server : how to filter out results of a 2nd query from the first query
Let’s say I have data that looks like this: I have some records that are retired and some that are active. The problem is some of my records have both retired and active rows. I only want records that do not have an active row. So in this example despite the fact that Greg has 2 retired rows. The fact
How to update one row that has max value in column (SQL Server)
I am trying to update the Rows that have the Max score with the value of ‘Yes’ in the Text1 column. This is straightforward except when there are multiple rows with the max score. If they have the same score, I just want to select the top row to have the value ‘Yes’. Only one row with …
SQL Server : fastest way to change rows to columns
I’ve got an issue regarding two tables in my database that have the following columns: COMMENT table Composite key made up of (KEY, TYPE, NUMBER) RESULTS table An example of the COMMENT table would be this: For each KEY, there are only 3 different types A,B,C and one TYPE may have up to 0020 in the NUMB…