Category "sql"

how to reference a macro list in a filter of sas query editor

Hello Stackoverflow community. I need to insert a filter into SAS Enterprise Guide query builder. This filter should contain a huge list of product codes, the f

How to INSERT now() + INTERVAL in Postgres 9.x

I'm trying to INSERT a future date into a timestamp with time zone column in a table in Postgres 9.6.2. I'd like this date to be the current transaction time pl

How to INSERT now() + INTERVAL in Postgres 9.x

I'm trying to INSERT a future date into a timestamp with time zone column in a table in Postgres 9.6.2. I'd like this date to be the current transaction time pl

How do I find yesterday's date

I'm stuck on a query regarding dates in Big Query using SQL. I have a table that consists of customer_id (int), date_purchase (date), sales (int). The query is

No suitable driver found for jdbc by Java 9.0.4 and Derby 10.14.2.0 and Maven

I'm trying to solve the problem with connection to Derby since a few days. I have always the same Exception: java.sql.SQLException: No suitable driver found

ASP.NET Exception Error From SQL Server Windows Authentication Login

I have read and tried all the suggestions from [https://stackoverflow.com/questions/22415319/system-data-sqlclient-sqlexception-login-failed-for-user][3] But no

ORA-12015: cannot create a fast refresh materialized view from a complex query

I am using below query to build a materialized view. CREATE MATERIALIZED VIEW gcms_business_profile_mview BUILD IMMEDIATE REFRESH FAST WITH PRIM

Rank actors with movies released in India based on their average ratings. Which actor is at the top of the list?

-- Note: The actor should have acted in at least five Indian movies. -- (Hint: You should use the weighted average based on votes. If the ratings clash, then t

UsageError: Line magic function `%%bigquery` not found

I am very new to Big query. I am trying to load data from a Big query table to pandas dataframe. I followed the syntax given in the documentation here. Unfortun

SQL AVG Alias with CASE

I am trying to run this query, but facing an unknown column error for Average: SELECT CAST(AVG(Lesson_CLass.T_Points) AS Decimal (10,0)) AS Average, CASE

SSMS Export Query Results to Excel or CSV

I am trying to export the results of a query to CSV and then ultimately Excel. My issue is, one of my columns has commas in it and the commas interrupt Excel

Pivot Multiple Columns in SQL

I want to pivot multiple columns like the table below: Original Table: ID ClientName RegDate Interest AMT Principal AMT 1 A 01-Sep-19 100.0

System.Data.SqlClient.TdsParser' threw an exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format

I am hosting .net core applicaton on server but when I try to run the application it throws exception in windows logs: Unhandled exception. System.TypeInitializ

Rolling 12 month Calculation SQL

I am trying to do a 12 month rolling calculation, but I get a syntax error at "rows", here is what I have so far: (SUM(YTDValue) OVER (ORDER BY PerformanceDate

Create View in SQL Server to create multiple rows for each date,with calculated date and identifier column

I need to create a VIEW/Select statement that will take a start date, and create 3 different rows for each date. One row calculates 30 days, from the start date

Display department names using Cursors.Create a PL/SQL block to display all the department names from the Department table using cursors

TABLE: Column name Data type Constraints DEPARTMENT_ID NUMBER(5) PK DEPARTMENT_NAME VARCHAR2(25) NOT NULL LOCATION_ID VARCHAR2(15) I have tried this. But stil

How can force SQL DateDiff function to stop rounding up?

I am working on a query that tries to count from an exact date to an exact date. Today is 2/16/2022. Between 6/30/2020 and 2/16/2022 19 months have gone by. My

Skipping same entries in different rows of a column in SQL table

for example I have created a dataframe in R named as "Numbers" which has following output: Numbers 1 2 3 2 4 1 When I tried to insert this dataframe in SQL tab

Exporting a hana table having 220 million records using hana Export Command

I've a Hana table having 220 million records. (Size 12GB). We currently use Informatica which performs a select * on my_table and exports a pipe separated data

Oracle SQL statement returns no rows when executed from C# application

Following SQL statement returns data when executed in Oracle SQL Developer: SELECT TC_GUID FROM TBLBUF WHERE TC_DEST = 'aaaaaaa' AND TC_STATE <= 20 but when