SQL: return many to many in one table

Using a MySQL database I want to store daily measurements of different "channels": date | channel | value -----+---------+------ 1.1. | 'A' | 1 1.1. | 'B' | 2 1.1. | 'C' | 3 2.1. | 'A' | 4 2.1. | 'C' | 5 3.1. ...
more »

2017-09-18 22:09 (1) Answers

Rails pagination - faster count of total pages?

I'm using the Kaminari gem to paginate my searches: @outfits = Outfit.where("description LIKE ?", "%warm%").page(params[:page]).per(20) And using this code to decide whether or not to show more: <% unless @outfits.current_page == @outfits.tota...
more »

2017-09-18 19:09 (2) Answers

Why I can't obtain record in a range of date?

I am not so into SQL and I have to create a complex query. My idea is start to a simple query and enrich it step by step. I am using MySql I ahve some doubts about a possible smart way for the first step. So I have a MeteoForecast table like this: ...
more »

2017-09-18 17:09 (1) Answers

How to refresh a Loop or update a Loop in VBA

So I have this list that is X rows long. Each has 5 columns: Equipment, Type, Material, Size and Price this is in the Sheet2. I also have a database in sheet1 with the same column filled in. I have written a code in VBA that for each row in Sheet2...
more »

2017-09-18 14:09 (1) Answers

BCNF and 4NF property

I read a statement "Relation R in BCNF with at-least one simple candidate key is also in 4NF" I don't think that it is always true but I am not able to prove it. Can someone please help ? ...
more »

2017-09-18 09:09 (1) Answers

Managing constantly changing data in Database

I need some advice on how to architect my data in monogoDB. I have this app, where users can view, add, edit and remove credit and debit transactions. Below is how the data looks. The balance column here is dynamic. For example if someone adds a tr...
more »

2017-09-17 07:09 (1) Answers

Can I use OR when joining two tables?

SELECT Notifications.message, BusinessAccounts.employee_username FROM Notifications, BusinessAccounts WHERE Notifications.notification_by_business_account_id = BusinessAccounts.account_id AND Notifications.notification_business_id=5 In this situati...
more »

2017-09-17 03:09 (1) Answers

store date picker value in database

I am trying to store the value of the date picker in my database. so far, i have been able to store the other values but not the date picker value. Form: <form class="form-signin" name="Register_Form" method="post" action="reg...
more »

2017-09-16 21:09 (2) Answers

Big database project on ASP.NET MVC

I'm working on really nice project in ASP.NET MVC, where comapnies can generate some pdf documents, save some data etc. I have a piece of project already. [no important] Programist will add Company with one AdminUser, AdminUser[Boss of company or sm...
more »

2017-09-16 14:09 (1) Answers

Reduce database requests in local db

I have a list view in android where i have to check every time do display the List item or not to reduce the requests what i did is saved the id in a single row like 1,2,10, everything was working fine to search i just had to use String[] fav...
more »

2017-09-15 10:09 (1) Answers

Image file not being stored in laravel project

Hello guys I need some help from you guys. I am creating a laravel project where I have modified the default users table to store more informations of users like name and user image file name. So that I had to modify 'RegisterController' class where ...
more »

2017-09-14 05:09 (4) Answers

Retrieve sql data and generate as json file

I am trying to retrieve the data from mySQL and generate as JSON file. But the output is just showing only 1 row. There are many rows inside the database table. What is wrong with this code? $sql = "SELECT * FROM form_element"; $result = mysqli_qu...
more »

2017-09-14 04:09 (1) Answers

SQL Server get latest value by date

I have a SQL Server table that has project_id int,update_date datetime ,update_text varchar(max) The table has many updates per project_id. I need to fetch the latest by update_date for all project_id values. Example: project_id update_date ...
more »

2017-09-13 19:09 (4) Answers