(SQL) Want to know request numbers that exist with one value but not another

Advertisements I’m querying a single table that has a column (SignatureDocumentType) with two possible outcomes ‘PreliminaryTestReport’ and ‘FinalTestReport’. When either exists for a single RequestID a new row is created. I want to know all RequestIDs where ‘PreliminaryTestReport’ exists but ‘FinalTestReport’ doesn’t exist for the same RequestID. When I run the below I return no… Read More (SQL) Want to know request numbers that exist with one value but not another

How to extract only numbers from string in mysql

Advertisements I have a data like under mentioned in table in one column name remarks Will0017,Will0018, Kind0045 , DGRG0012 I want to extract only numbers from the same only like 0017,0018,0045,0012 How can I do the same in mysql. I have tried like this select reject_remarks,regexp_substr(reject_remarks,"[0-9]+") from table; but have anything like I want I… Read More How to extract only numbers from string in mysql

SQL Query to sort distinct records by number of duplicates

Advertisements I have a table of tasting notes, and I want to create a wordcloud with the biggest words corresponding to the most-often-mentioned words in the following table, ideally also considering their priority. tbTastingNote ID tasteCat priority value Blender’s Reserve Finish 1 Nutmeg Blender’s Reserve Nose 1 Vanilla Blender’s Reserve Palate 1 Apple Blender’s Reserve… Read More SQL Query to sort distinct records by number of duplicates

How to select all records from multiple tables in MySQL even if no match in some tables

Advertisements I have three tables (Stores, Item & StoreInv) and I am trying to do a join that contains all records from Stores & Items even if there are no matching records in StoreInv. Probably easiest to explain by an example: Store table: StoreId ——- Store1 Store2 Store3 Item table: ItemId ——- A B C… Read More How to select all records from multiple tables in MySQL even if no match in some tables

SQL Return multiple values from 2nd table where joined from 1st table

Advertisements I have 2 tables. 1 Item table & 2 Category table. I need a query which returns the cat_Code, Cat_Desc and Cat_DescShor data from the category table where the value in the Item_cat 1,2 & 3 columns in the item table matches the Cat_ID in the category table. item table item_code item_desc item_cat_1 item_cat_2… Read More SQL Return multiple values from 2nd table where joined from 1st table