I’m getting this error Msg 103010, Level 16, State 1, Line 1 Parse error at line: 33, column: 15: Incorrect syntax near ‘@sas_token’ For reference here are the guides I am following: https://learn.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/quickstart-bulk-load-copy-tsql-e…
Tag: sql
Oracle DB sql group the table_names patterns into a group
I am trying to classify certain patterns of tables in individual groups and display the results this is fine i included a case statements and classified it but how to group the counts , let provide the sql logic and existing results and expected results so that it will be understood. database is Oracle 11g SQ…
Parse out word between two characters SQL Netezza
I am having trouble finding the correct syntax to parse out a word between two characters in Netezza. PATIENT_NAME SMITH,JOHN L BROWN,JANE R JONES,MARY LYNN I need the first name which is always after the comma and before the first space. How would I do this in Netezza? Answer I think Netezza supports regexp_…
Bigquery SQL MAX() text value
Thanks for taking the time to look at this. How to get the MAX of a text value in column A. I would like to and another where clause to show only one of the “FY20-Q4M#” (MAX value only) Current Table YY-QQ_STATUS Program FY20-Q2_ACTUALS XYZ FY20-Q3_ACTUALS XYZ FY20-Q3_BUDGET XYZ FY20-Q4M0 XYZ FY20…
Need a SQL Server query to eliminate the Highlighted Rows ( Returning Routes in Flight)
I have a requirement where I need to eliminate all the rows which have returning flight routes. I have highlighted the routes in the orange color which depicts this behavior. For example, row 1 has one route BKI – MYY and row 4 has MYY – BKI. I need a flag (Boolean 1/0) that checks the entire row …
How to ungroup the grouped record based on count column using SQL
I have below data set obtained after group by dept and loc. dept id loc count 100 a 2 300 c 1 I need out put like below deptid loc 100 a 100 a 300 c please help Answer Another option is to use Recursive Queries to get the desired result. DB Fiddle Link: https://dbfiddle.uk/?rdbms=oracle_18&fiddle=0580680e…
Sql conditional Join statement
I have this sample I want to code this case in sql : When i have a null value in “ASS_OT_Traveaux.CodeEquipement” it doesnt show any data Answer
Unique Indexes query for HSQLDB
I’ve got a query that selects unique indexes from a MySQL DB table: I am looking to create the equivalent query that works for HSQLDB Any help is much appreciated! Answer That’s available in information_schema.system_indexinfo
sql – union tables with same prefix
I have a set of tables with same prefix and same structure. All I need is to “combine” them as one. Basically I retrieve tables with certain pattern from information_schema.tables, then get rid of the last union all. Above method works for 20-30 tables, as the @result won’t exceed the limit …
If a column is not null then convert into a row for multiple columns
I have a table like below where I looking to transpose col4 col5 and col6 into rows but in a specific pattern that I listed below col1 col2 col3 col4 col5 col6 a b c 500 200 w x y 1000 300 z g h 200 600 I want to convert it to the following col1 col2 col3 col4 col5