I need to decide which database to use for a system where I need AP from CAP theorem. Data I constantly but slowly going in. Big queries are expected. It should be reliable – no single point of …
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:
Extract day of week from date field in PostgreSQL assuming weeks start on Monday
extract a number from 0 to 6, where 0 is Sunday; is there a way to get the day of the week in SQL assuming that weeks start on Monday (so 0 will be Monday)? Answer From the manual So, you just need to subtract 1 from that result:
how to select a list of 10,000 unique ids from dual in oracle SQL
So I can’t create or edit tables (I’m a user with read only permission) and I want to look up 10,000 unique id’s. I can’t put them inside of an IN() statement because oracle limits over 1000 items. Is it possible to select this entire list from the DUAL table in oracle? Something like:…
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…
Query single row from join table and total count of joined table
I have two tables: accounts and users. users references accounts through account_id. What I want to do is get following query to work: `SELECT accounts.*, count(users.*), user.* FROM accounts …
MS Access Query to get multiple counts from the same field
I’m querying imported data that has a date/time field that I can’t format as date in the table. Sample: Ticket Name Date INC000101 User1 9/5/2016 10:00:34AM INC000102 User2 9/5/2016 12:02:…
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 …