Skip to content

Tag: sql-server

Snowflake BIT datatype

i have BIT data type in sql server and i am trying to migrate it to snowflake but i am not able get the data into snowflake properly 0 goes as 0 but 1 goes into as 255 when i DT_UI1 data type to output the column in sql server can anybody help me how to send bit data type

SQL Get Parent when child is column is 0

I have two tables below. Data: Using joins I have got the information from both the tables which have needed, but in a new case I need to extract the Address like if the IsNetwork = 0 then Address should of it’s the parent. Following is the query of join This is the output of that query: I want the

Replace subquery with join for the same table

Can the expected result in this case be accomplished without a subquery ? Maybe using a join ? We have a name say ‘jose’, Expected result is all rows which has same color as jose. Query should run in both MS-SQL and ORACLE. http://sqlfiddle.com/#!18/5f7e3/2 Answer You can get this result with a JO…

Are indexes on columns with always a different value worth it?

Does creating an index on a column that will always have a different value in each record (like a unique column) improves performances on SELECTs? I understand that having an index on a column named ie. status which can have 3 values (such as PENDING, DONE, FAILED) and searching only FAILED in 1kk records wil…