Skip to content
Advertisement

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 queue_type =’Y’. As the

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=8a678d12df7643000838c2f442d4d85a query 1- weekly data quary-2 yesterday data expected output, driver_id car_number day1_trip day2_trip day3_trip day4_trip

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 and then use

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 value Answer Assuming your messages have the fixed format of: we can use

How do I aggregate data in sql for multiple rows of data by column name?

hi im new to sql and trying to understand how to work with data structures. I have a table If the interaction userkey number repeats then, i want a column called number of visits. in this case, for interactionuserkey 5, there are 2 total visits since its repeated twice. for interactionuserkey 0, number of visits =1 and so on. Basically,

Advertisement