Skip to content
Advertisement

Tag: sql

Can I bookmark SQL query with bind parameter?

I’m quite new to databases. I’m using phpmyadmin and I’m writing just simple SQL queries. I’m curious if I can bookmark a query with bind parameter so I could set the parameter next time again. I have the following query and I want to set myID every time I run the query without rewriting it in the code. Is it

How to change the position of column in postgresql without dumping

I know the only workaround is to dump the table and then recreate the whole database with correct positioning of the required columns. But the problem is one of the columns is a foreign key to many tables in the database so it would not be possible to just delete the whole table. Also I cannot delete any column as

Querying rows by index in S3 Select

With mysql the following code: would pull the 5th through 10th rows of the table. What is the equivalent for doing this through the SQL engine in S3 select (PrestoDB I believe)? Is there a rownumber constructor or operator that works with S3 select? Answer The S3 Select documentation is at: SQL Reference for Amazon S3 Select and Amazon Glacier

How to write SQL for combination of AND?

Please check the attached table. I need to write a query to get documents which have both tage_id of say 32 and 26. Something like select * from doc_tags where tag_id = 32 or tag_id = 26 is not going to work as I will get both documents with 32, 26, and ( 32, 26 ). I need documents which

Filter out certain rows based on condition

I have this Input Table: I want to check each project separately then exclude If the project owner has his name inside col2 and other people with him, then remove the row which is repetitive Jack Jack, a. For example, In Project B Jack has his name inside Col2 and he is working with Maria , so remove Jack Jack

Remove nulls from an array in SQL

Want to remove nulls from an array in hive/sql for example : array is [‘1’,null] after converting to string values it should be ‘1’ only. to split the array I am using below: concat_ws( “,”, …

Select query where exists intersection of two list

I have one table that contains two columns: id (integer) list_colum (longtext) – contains json array (e.g. [1, 2, 3]) I want to select all records that have an intersection of my input list. Let me explain: My input is a list – [2, 3] Pseudo code: Is it possible to do this in SQL? I am using the newest

Hibernate not allowing to increment by 5 in sequence

I have following db sequence Java However with Hibernate I am getting following error which says hibernate is expecting increment by 50. Why is so? Edit1 Added java code. Answer The error message is quite clear. You have enabled (or not disabled) schema validation, so when the application starts Hibernate is comparing the database with what it expects from annotations

Advertisement