Is there any way on how to convert a comma separated text value to a list so that I can use it with ‘IN’ in SQL? I used PostgreSQL for this one. Ex.: This query: produces ‘SG’,’PH’ I wanted to produce this query: Nothing returned when I executed the first query. The table h…
Tag: sql
Query using min() not showing the correct result
I have this table: CREATE TABLE IF NOT EXISTS `Vars` ( `ID` bigint(20) NOT NULL AUTO_INCREMENT, `code` varchar(15) NOT NULL, `userID` bigint(20) NOT NULL, `viewedT` bigint(20) NOT NULL, …
How can I find the dependencies of a multiple objects in sql databases?
sp_depends will provide information for all dependent objects on a particular objects But it is working for only single object , giving information about single object. I want the information about multiple object, How can I achieve it using sp_depend or any other way is there? Answer You want sys.sql_express…
ANSI SQL version of SELECT TOP 1
Is there an ANSI SQL compliant version of SQL SERVER’s SELECT TOP n?
Dynamic Pivot Columns in SQL Server
I have a table named Property with following columns in SQL Server: there are some property in this table that certain object in other table should give value to it. I want to make a pivot table like below that has one column for each property I’ve declared in 1’st table: I want to know how can I …
If pagename then run statment
I’m building a blog and have two tables articles and categories and I’m joining these tables, but what I want to do is display just the categories if I click a categories link. I’m passing the …
autoDocumentation of SQL queries [closed]
We use SQL queries to do most of analytical work at our company (PostgreSQL). Currently there are 250+ queries stored in fixed directory structure (there is also a lot of DDL/DML files). Is there …
T-SQL get number of working days between 2 dates
I want to calculate the number of working days between 2 given dates. For example if I want to calculate the working days between 2013-01-10 and 2013-01-15, the result must be 3 working days (I don’t take into consideration the last day in that interval and I subtract the Saturdays and Sundays). I have …
UPDATING Table Column with new Entry
I am working on Oracle APEX. I want my report to show me the updated Debit value in Total amount column.The Report Query is shown in the following diagram mentioned below. Required Scenario: I want to update the TotalAmount Column with Debit and Credit. The new Debit or Credit value has to be shown in the Tot…
ORA-00928 missing SELECT keyword in Oracle
I’m using the following code to insert data. But I’m receiving an error as “ORA-00928: missing SELECT keyword” try { Class.forName(“oracle.jdbc.driver.OracleDriver”); java.sql.Connection conn = …