Skip to content

Tag: sql

Search List Stored in Column and Eliminate Row with SQL

I have a table (MYTABLE) in an Oracle database that has a column which stores a list of items. Something like: ITEM_ID ITEMS 5476301 B, L, M, PP, S, TT 5579504 B, L, M, PP, S, TT 5579504 B, L, PP, S, TT 4005953 L 4064254 L, M 4121291 PP 4162254 M 4189256 M, PP 4255971 M, PP I am

SQL: Making a conditional WHERE clause?

I’m pretty new to SQL and am struggling to get the syntax/logic correct for what I need. Right now I have a query ending in a where statement: Basically I need all the results, except for data points that have queue = ‘Q1′. For those instances only, I need the results to filter down to where…

Not getting proper data while join two query in Mysql

Hi Everyone i am writing a query one query getting weekly data one is getting yesterday record from same table, when i execute both query separatally its working properly but when join both query then yesterday data query not getting proper output. Sampal data https://dbfiddle.uk/?rdbms=mysql_8.0&fiddle=8…

How to using oracle distinct and order siblings by at the same time?

the distinct broken the order siblings by,how can i use them at the same time? such as select distinct * from table xxx starts with … connect by id=pid order siblings by field here is the test sqls executed with different results here is the table Answer You can use ORDER SIBLINGS BY in an inner query a…

Capture string in between

How can I capture data in between a series of strings? I have the following data in a column: Basically, remove all before “INCIDENT TYPE:” and after “External ALARM ID:” “INCIDENT TYPE:” has no specific number of characters. And I only want to display the incident type val…