I have two MySQL Tables; City and Country, I want to allow a user to search across the two tables for something which matches in either, and I want a quality match/relevancy order from both tables. (…
Select most recent row filtered on multiple columns
I have an sql table +——+———–+———–+——–+————–+ | rowID| location | fk_Item_ID |Balance |Inventory_Date| +——+———–+———–+——–+R…
Storing multi rows from php to sql
When i send post from php to save input values in seperate rows i’m ending with that in ma table always is stored extra blank rows. For example this is the form from which i send post to save values: …
SQL JOIN and desired a view: 2 foreign keys referencing the same table
I feel I can’t solve my task without community help. Unfortunately, my knowledge of SQL is weak. I have 2 tables – user and referral which represents data about senders and referral of senders (…
how can I insert new rows from table 2 in table 1 with the corresponding date?
I have two tables that I want to join using a date field: Table 1: there’re multiple records for each date Table 2: there’s only 1 record for each date How can I update records in Table 1 with …
Query Hierarchical Queries
I wanted to profile my data set to find the data discrepancies. My sample date set: id status stdate enddate 1 new 01-JUL-17 31-JUL-17 1 process 01-OCT-17 31-DEC-…
SQL syntax alphanumeric characters, SQL Server
If I pull this ID down from my source system it looks like 9006ABCD. What would the syntax look like if I just want to return 9006 as the ID? Essentially, I don’t need the alpha characters.
Modify SQL to include cumulative sum of all enrollments
I am able to get members cancelled in a quarter with the below query – SELECT DATEPART(YEAR, Canceldate) [Year], DATEPART(QUARTER, Canceldate) [Quarter], COUNT(1) [id Count] FROM Subscription where …
SQL rotate results from wide to vertical
I would love some help with the best way to capture some column data and rotate it so I can store the column name and numeric value in a temp table. The results are a single row showing a value for …
Multi-Field Search Button (Query) Showing Records With or Without Missing Fields
I have a database with only 1 table, this table has 27+ fields and not all of them will contain a value (some will be empty). I have a button (“search alarm”) on a navigation form that performs a …