I am creating a blog using PHP and SQL, I am trying to query everything in 1 SQL query so I can bring out all of the comments with the authors and all of the blogs with the authors. Each of them have …
Cannot exclude previous non-duplicate rows
In a nutshell, here it is: I have 1000(ish) employees who have multiple recurrent annual training requirements I need to be able to sort the employees by County, Facility, Employee, and Type of Training (and also allow for sorted lists at each level) I want to display only the most recent date the Employee to…
Is it possible to convert a timestamp to human readable date (in any language) with CodeIgniter 3.1.9
Is it possible to convert a timestamp to human readable date (in any language) with CodeIgniter 3.1.9. As much as possibe, I would like to use helper (date helper). Input : 2018-11-01 17:12:26. …
Joining to return all rows even when there are no results
I’m trying to get a list how many products we’ve sold, per company, by all categories. I’d like the results to look like: Category A Company 1 0 Category A Company 2 0 Category A Company 3 …
postgresql two NOT LIKE clauses returning wrong results
I have a table with 88 codes. I am writing a simple select statement that does not select the codes that start with 10 or 18 select distinct pcl_mun from exemptions.modiv_parcels_2015 where (pcl_mun …
Query to concatenate rows based on data from multiple rows
I’m trying to print out xml results with a query in SQL Server 2014. The query is supposed return data from a date range, and return a concatenated list of player names and player times. The …
How can i get a count(*) of all the columns in a table? Using PostgreSql
I have bunch of tables where several of them have hundreds of columns. I need to get a count of non-null values for each column and I’ve been doing it manually. I would like to figure out a way to get …
SQL multiple rows calculate
I have a table in SQL Server and I am trying to calculate if a number is bigger than a selected row, but only if the rows that exist are greater than 1. I’ve looked online and looked into Union, …
ms-access-2010 returns #func[exclamation mark]
I have a sql-statement which includes a switch, i want to execute on ms-access-2010. sql: SELECT TABLE_1.ID, SWITCH ( (TABLE_3.ID IN (7,8) AND TABLE_1.SOME_COLUMN = 2), (SELECT MAX(TABLE_4.ID)…
Yii2 How to translate SUM SQL function to Query Builder?
I have this simple SQL query: SELECT product_name, SUM (product_amount) FROM orders GROUP BY product_name; It will show a list with product names and their amounts. Like this example: I want to …