I have two scripts which needs to be executed depending on whether a table exists or not in my database. So I created a 3rd script as below which checks the condition and calls the respective script. [Because my installer cannot reach db and it can only call one script while installation] END; I get the below…
how to match two columns in a join by a third “mapping” table
I’m trying to do a VLOOKUP like join in sql. I have 3 table: dest_table: target_table: map_table: Wanted output: Answer Yes, you can do this using joins.
Reverse to STRING_AGG
Here is a sample data on which we are further processing. My question is, is there any exact reverse of the STRING_AGG function for SQL Server? Like I am merging using STRING_AGG with the following code I need to reverse the process but I had to use CURSOR so I am searching for an alternative solution. Below …
Different user login problem because of the syntax error [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question In my program, I want different users to have different class_id in order to let them go int…
MySQL show proportion
I am trying to show a proportion of customers that signed up because he/she was being referred by other customers and customers with no referral. So far I only able to show it as numerical but I wanted to show it in percentage. Null is when the customer signs up without being referred. The original data as fo…
Convert 15min to 10min timeseries in SQL Server
I have a timeseries in a 15min format with four different variables. I need to convert this into 10min timeseries format. Due to some constraints, I need to do this in SQL which I agree is probably …
MS Access SQL query a table and remove duplicates
I have reviewed several posts here and can’t find the answer, but it may be that the problem and answer are a bit above my pay grade. I have an MSAccess Table with two ID fields (ID1 and ID2), and …
Count and group data by Year/month and by user
I have a dataset that looks like this: GO CREATE TABLE [dbo].[taskDB]( [ticket] [varchar](50) NULL, [created] [date] NULL, [closed] [date] NULL, [rating] [varchar](50) NULL [user] […
MySql regexp on column with html
I have a table with HTML content in which I need to select all rows containing a span element with the CSS class “glyphicon glyphicon-film” with some text content, but exclude all rows …
SQL: Select all rows that are in range of 2 kilometres
Assuming I have the following PostgresSQL table locations name/longitude/latitude: name | longitude | latitude —————————————– A | 14.02023923239 | 13….