SQL joining 2 queries that share a column

SQL
I have 2 SQL queries that share a column called catalogid Query #1: Select catalogid, numitems, allitems - numitems ignoreditems from (selec...
3 years ago

Query for pagination on the SQL side

SQL
How can I implement custom pagination in mysql using a query? Based on the page number I need to fetch the records from the database, is it possible? ...
3 years ago

Multiple iifs in one grid in Microsoft SQL ReportBuilder 2012 3.0

SQL
I'm making an automatic invoice in reporting services for our company but I'm starting to run into some issues. The invoices are made monthly and most...
3 years ago

duplicate mysql result to cycle it twice

SQL
I need to cycle a mysql result twice. so I decided to duplicate its result into a new variable: $result = mysql_query($query, $db); $result_copy = $r...
3 years ago

Still return JOIN result when no match

SQL
I have a join in one of my queries but when the join returns nothing, the main query itself returns nothing and not sure how to still have query run w...
3 years ago

Using wamp server how can I have mysql directory on another location?

SQL
I have wamp installed on my windows and I need to have whole wamp mysql-server directory files (and not only database files asked in similar questions...
3 years ago

Replace() in SQL isn't working with "

SQL
I'm receiving a JSON string into a database which I'm trying to convert into a comma delimited list. This is my current state: My SQL currently loo...
3 years ago

oracle sql query statement NVL not working as desired

SQL
I am trying to learn oracle sql and below is my query. I wanted to print everyone's manager and if someone doesn't a manager then it should return "No...
3 years ago

Find maximum row per group in Spark DataFrame

SQL
I'm trying to use Spark dataframes instead of RDDs since they appear to be more high-level than RDDs and tend to produce more readable code, but I wou...
3 years ago

python and mysql connections in a class , DB open and close strange behaviour

SQL
I have written a small app that uses mysql to get a list of products that need updating on our magento website. Python then actions these updates and...
3 years ago

validating with ajax and jquery

SQL
This is what I've done so far. <span id="error_para">*</span> Username:<input type="text" name="field_username" oninvalid="setCustomVa...
3 years ago

Postgresql (PLPGSQL) trigger assignment issue

SQL
Given the following schema for a postgresql 9.5 database: -- -- DOMAINS -- CREATE DOMAIN data_sources_url_domain AS text NOT...
3 years ago

How can I stop all rows from updating where conditions are met

SQL
I'm working on an assignment for college and have a PatientAdmissionsTbl, it stores all patient admissions in to various wards and has a DateDischarge...
3 years ago

Forbidden :You don't have permission to access /phpmyadmin on this server

SQL
Hi I have installed phpmyadmin on my centos machine and when I try to hit phpmyadmin through my browser I get this error : Forbidden You don't have p...
3 years ago

How can I raise an exception from within a Mysql trigger?

SQL
Please consider my trigger snippet: SELECT COUNT(*) INTO num_rows FROM courses WHERE course_id = NEW.course_id AND maxsize > stu...
3 years ago

LEFT JOIN with relative value from main query

SQL
I've two tables: users and friendship. For example: users table: id | user | email | website 1 | Igor | i@o.com | stack.com 2 | Lucas | a@i.co...
3 years ago

How to output a boolean in T-SQL based on the content of a column?

SQL
I made a view to abstract columns of different tables and pre-filter and pre-sort them. There is one column whose content I don't care about but I nee...
3 years ago

MySQL assign query value into variable

SQL
I made procedure listed below: delimiter // CREATE PROCEDURE processPayment(in id int(11), status int(11)) BEGIN declare msg_a text DEFAULT "Payme...
3 years ago

JPQL SQL make a query base on a list of arguments

SQL
I have a class Person as followed public class Person{ String name; //---------- } I would like to query the list of persons where name are l...
3 years ago

MySQL Foreign Key Error Code 1215

SQL
I'm receiving an error attempting to add columns to a table with a foreign key to an existing table. Here are the two SQL statements that fail: ALTE...
3 years ago