Skip to content

select Parent Child Rows in same Table

I have table structure like below id |parent|value 1 | 0 | a | 2 | 1 | b | 3 | 4 | c | 4 | 0 | d | 5 | 0 | e | I want to display only rows that have a relation parent child like:…

Extracting data from JSON field in Amazon Redshift

I am trying to extract some data from a JSON field in Redshift. Given below is a sample view of the data I am working with. I am able to extract data for the first level namely data corresponding to fileFormat and data as below: I am trying to extract information under data like name, age,dateofbirth Answer Y…

Dynamic SQL Select variable name

I have the following SQL statement, which works fine: DECLARE @TableName VARCHAR(250); SET @TableName = ‘TBL_Name’ SELECT QUOTENAME(@TableName) As TableName, HASHBYTES(‘SHA1’, (SELECT * FROM TBL_Name …