Skip to content

Tag: sql

Register temp table in dataframe not working

Below is my script to use sql in dataframe with python: df.show(5) shows result below: then I register the dataframe to a temp table: and tried to run some sql query like below: It doesn’t produce expected result, instead: I also tried: and it gives me: So it seems the registerTempTable method only crea…

Count on case Oracle

WE have below data in oracle database – I want count on column two in such a way that – Ouput – Best Regards Answer Thanks Guys. But I could do this way – Thanks for your replies

Teradata REPLICATE function?

I’m converting MS SQL Server codes to Teradata. I found out that Teradata has no replicate function. Below is the sample code Is there an alternative function for replicate in Teradata? Thanks Answer Try this: This will repeat the character ‘0’ two minus the length of the column, which is ef…

Generic repository with Dapper

I’m trying to build a generic repository with Dapper. However, I have some difficulties to implement the CRUD-operations. Here is some code from the repository: As you can see, my delete-method takes a TEntity as parameter which is a parameter of type class. I call my Delete-method from my UserRepositor…

Get current time without Date

How do I get the current time only? Gives me: I want this result: Answer You can convert the GETDATE() results to a TIME datatype to pull the current time:

php How to link comment sql to the blog sql

first time here and I hope you guys can help me further. I have created a blogging system to use by mine employees via an admin login system. As well a login system and registration system to use by my customers/viewers. So now I created a comment section for the blog system where people can commenting. The p…

Hive describe extended table return json

Is there any way to run “describe extended table” in Hive and have the results returned in JSON, XML, or some easily parsed format? Or is there an existing parse in Java that can parse this type of …