My data looks like this, I have multiple values in the Table field with each having its own unique values for the Data field. However, Data values for TableA will be the same format in the table …
Tag: sql
Select statement using Group-by while ignoring column on Postgresql
I have a table name “report” in Postgresql db like: Student Class Marks Observation_time A 1 11 21/7/2020 A 2 13 18/7/2020 B 1 19 17/7/2020 A …
How to mimic sql statement logic in cfml / coldfusion?
I Am coming to a problem where I am trying to convert my sql statement to do the same logic in cfml (cfscript>) so, I am trying to mimic this sql statement to display the results inside my cfscript. can somebody help me solve this issue? thanks for the help. SQL: Answer @Scott, I am assuming that: Each row from
Error :: “Conversion failed when converting the nvarchar value ‘cereals’ to data type int” in Dynamic SQL
I am trying to “Order by” my table by Id in Dynamic SQL, though it works with Name and Description (Both Type Nvarchar) as shown but not Working with Id (type INT), Here is my Dynamic SQL Query The Line Gives Following Error Conversion failed when converting the nvarchar value ‘cereals’ to data type int. I print SQL It shows
Is there any pros to not using Many-to-Many relationship [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question I have been asked to create a small program for assignment based on given instructions. I was given two tables I
SQL Server Grouped Number Generation
I need a way in a SQL Server query to generate grouped numbers when the data switches from one specific data value to another. Based on the first two columns below and how they are ordered, how can the query generate the numbers in the third column? When the Type column changes from Prim to anything else, all the records
INSERT SELECT statement with only one column for SELECT
I’m using SQL Server Management Studio 18 and I’ve got the following tables with the following columns: TableA TableB I want to do an INSERT SELECT into TableB, maybe something like the following: Basically, I just want to make an INSERT SELECT where I’m grabbing a column from another table (InternalEmplID), and then for the other columns (Month and Year),
Optimizing GROUP BY + COUNT DISTINCT on unnested jsonb column
I am trying to optimize a query in Postgres, without success. Here is my table: I have indexes on id and meta columns: There is 62k rows in this table. The request I’m trying to optimize is this one: In this query, meta is a dict like this one: I want to get the full list of key / value
SQL – Matching only the values in IN clause (not less or more)
I am having the following ManyToMany table TEAM_USERS with the below data: So, I want to get the TEAM_ID that is having only two user with the USER_ID IN (3, 4), in this case it’s team 11. But I am getting team 1, 11, and 12. And I want only team 11. I did the following code but I am
how to Join array with string in Snowflake
I have two tables: Books with column tag_ids (Array) Tags with column tag_id (Varchar) I have a visualisation tool that need to join these tables together. The only thing that I can control over is the join condition. the problem is that I can’t find a way to make this join work. this is what I tried: This works only