Mysql – Django: Multiple inputs with foreign key
I wanted to add more users for a shift. But it's a foreign key. How to do I make it? It does add, but if I choose more than one user, it shows this. Field 'id' expected a number but…
I wanted to add more users for a shift. But it's a foreign key. How to do I make it? It does add, but if I choose more than one user, it shows this. Field 'id' expected a number but…
i consider myself a pretty well-versed developer, but this one has me stumped. The actual use case is somewhat more complicated than this (i have built a data-view framework that allows you to filter and search data), but at its…
I have a mySQL database with several tables. But one tabel contains af 1,400,000 rows. I need to get the 50,000 rows with the highest value in one field. A field that counts visitors. SELECT uid, title, number, views FROM…
I'm new to multithreading and don't even understand what to do with a thread in my application. The application is a console game. The player chooses a hero, clan and actions. Gold is credited to the treasury for various actions.…
I have this following query that needs to be optimized Select 1 As status, e.entity_id, e.attribute_set_id, e.type_id, e.created_at, e.updated_at, e.sku, e.name, e.short_description, e.image, e.small_image, e.thumbnail, e.url_key, e.free, e.number_of_downloads, e.sentence1, e.url_path From catalog_product_flat_1 As e Inner Join catalog_category_product_index_store1 As cat_index On…
Hello I had an sql getting the number of orders this week. My sample query below: SELECT products.name, (SELECT COUNT(orders.product_id) FROM orders WHERE orders.product_id = products.id AND DATE(orders.order_date) >= [from] AND DATE(orders.order_date) [to]) as total_orders FROM products p; Now I…
I am working on an application using NextJS and Typescript and am attempting to determine the best way to properly type my MySQL responses. Here is the API endpoint: import { hash } from "bcrypt"; import type { NextApiRequest, NextApiResponse…
I have the following tables: Table 1: Number PK Word PK 1 A 1 B 1 C 2 B 2 A 2 C 3 J 3 K 3 B Table 2: Number2 Word2 1 A 2 X 3 B I…
I have a database with email and phone columns. One email can have several phones, which results in multiple rows with same email but different phone numbers. I want to query all emails with it's phones grouped in one single…
I'm building a form that has a select component that is wrapped with an array from an API MySQL "get" call. The array contains 3 items; userID, firstName and lastName. Upon making a selection, the value of the select input…