I want to write an SQL query to find records which contain a particular column and from that subset want to find records which doesn’t contain a some other value. How do you write a query for that? …
Tag: oracle
Escape single quotes from comma separated string in Oracle
I am trying to escape single quotes from the comma separated string in Oracle SQL Developer, below is my Select query: SELECT (CASE WHEN PS.SUPPLIER_NO IS NULL THEN ‘FALSE’ ELSE ‘TRUE’ END) AS “Check”…
Using ROLL UP/CUBE in conjunction with PIVOT [Oracle]
I have a table in Oracle that looks like this: year month customer ———————— 2011 Jan Smith 2011 Jan Smith 2012 Feb Howard 2013 Feb Howard … Now I …
Search each value of Column A in Column B in SQL Oracle
Let’s say I have this type of dataset: row Num_A Num_B Num_C Reg_1 Reg_2 —— —– —– —– —– —– 1 9400 9500 9700 AAA CCC 2 9700 …
Oracle – Coordinate extraction from vertices (first, last and all vertices)
For a given feature (line or area) and for all of its members I need to extract the coordinates of (1) all the vertices, (2) the first vertex and (3) the last vertex (3 separate queries to create 3 …
How to use LIKE in oracle with PHP
I am trying to use a simple SQL statment with the LIKE operator. This SQL statement works on SQL developer but not when I try it on PHP. SELECT * FROM hotels WHERE lower(name) LIKE ‘%luxury%’; …
how to write group-by query SQL with quantity unit conversion?
Stock Product Quantity Unit ——————————- 001 5 box 001 10 bottle 001 60 gallon Conversion Unit1 Unit2 Rate ———————- …
How compare NUMBER with ‘TYPE IS TABLE OF NUMBER’?
I have query, where need select ID and name by ID. First I check the ID using the function. In the function, I get several values that need to be compared with the ID. When I make a check it gives …
Can I declare and use variables “inline” in Oracle SQL?
can I do something like this pseudo code and use variables inline within the select? I know that in this case variables are not needed, I have a more complex use case in mind. select t.foo, t.bar, …
Root level node is not coming in result
I am new to the Oracle Hierarchical Queries. I have one table and have the below data. Table Data Result Data My question is why parent id(100) is not included in the result? Below is the query. …