I am new to mySQL. I want to update the order price of a table, based on the value of the retail price and the quantity of the product ordered. I have the following tables (simplified for this …
Having an issue with a stored procedure SQL-Server
I’ve got a stored procedure that i’m having some issues with. I’m trying to lookup against my table GOTWVotes and if VotedBy hasn’t voted before write the vote to the table(this is working) however …
How to split a column in two columns
I have an issue with a table called “movies”. I found the date and the movie title are both in the title column. As shown in the picture: I don’t know how to deal with this kind of issues. So, I …
How can I not send Null to database while using Update
If i need to just update one column do i have to give other column previous value or i can just give give the column i need to change and not null values to update in database .. here is procedure …
Find the record nearest to the datetime specified
I am trying to retrieve the data from a table which is the closest to a specified date and time for example as you can see below little bit of data about doors and if they are open and closed at a …
How to use result of first query in second query where condition?
I have to select two tables data, One is PackageData and another is PackageDataDetails. Here is PackageData is Parent table and PackageDataDetails is child table. See below code: SELECT PD.Id, …
Why query is still so fast when I operate a non-indexing column?
I am learning indexing of database. here are indexings of a table. And this table has 330k records. mysql> show index from employee; +———-+————+————-+————–+———…
How to use LIKE in oracle with PHP
I am trying to use a simple SQL statment with the LIKE operator. This SQL statement works on SQL developer but not when I try it on PHP. SELECT * FROM hotels WHERE lower(name) LIKE ‘%luxury%’; …
how to write group-by query SQL with quantity unit conversion?
Stock Product Quantity Unit ——————————- 001 5 box 001 10 bottle 001 60 gallon Conversion Unit1 Unit2 Rate ———————- …
Best way to do a IIF conditional with subquery
I have a select with subquery inside like SELECT …. , (SELECT TOP 1 [DDC].[ContractedAmount] FROM @CustomersTable AS [DDC] …