I’m working on a user login system for a semester final. I am using C# in Visual Studio with ADO.NET. I have a query that I use on a database table named Credentials: SELECT * FROM Credentials WHERE …
Tag: sql
Why can’t I loop through and drop databases?
There is a scenario where I want to go through and remove all databases that have specific text in the database name. It always drops one database and then does nothing. How can I fix this? def …
Sumarize colums to get just one value
I get the result shown below, but I need to get only one row with the sum of the column QTD_PARC and VL_TIT, this in the SQl Server, can someone help me please?
Subtotal of child records without COUNT?
ParentSub Table: ParentCode SubCode CompanyName MEGA1 MEGA1 Megacorp MEGA1 SUBC1 Subsidiary Company MEGA1 EASC1 East Coast Operations MEGA1 EURC1 Europe Company BIGLY ALPH1 Alphabet Company …
SQL inner join on column A and compare values in column B
I am sure or maybe hope there is a simple way to do this. Below is my latest attempt. The query should return only one row, but I get 31. Query: `select distinct a.[EC CERS], a.[EC Tank ID], […
Group by and display count in Excel
I am trying to learn some Excel’s features and I want to know if it is possible to make an SQL-like statement in Excel. For example, I distincted a dataset and the output is: I want to make a count(*) and a group by like: Answer Initial data: Create a pivot table. When you drag columns like this… …
Error in SQL syntax [function in node-red]
I’m trying to post the data into database through node-red but I got this error. “Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘insert into customizations(custom_id, product_id, pa…
How can I output text until it is ascii in SQL?
How can I output text until it is ascii in SQL? Here is what I am trying to do: But in the end I am getting an empty string. Why? What am I missing here? I am expecting the value of the @output to be ‘text’ in the end of the script. UPDATE If I update the script to the
How do i transpose and grouping in PL/SQL [ORACLE]
I have this table: USER DEP USER1 DEP1 USER2 DEP2 USER3 DEP2 USER4 DEP3 But i want to transpose it and group user under DEP. DEP1 DEP2 DEP3 USER1 USER2 USER4 USER3 NULL NULL What i have tried following pivot query. The output is: 00933. 00000 – “SQL command not properly ended”. How do i use …
Fix duplicate rows while selecting nested fields from BigQuery using JOIN and UNNEST
I am trying to copy data from one BQ table to another and having trouble with un-nesting and JOINs. I have two fields of REPEATED RECORD type in my schema and when I try to JOIN those, I get a lot of duplicate rows. Here´s my query: What I want to achieve is: But when I JOIN Address and Work,