Skip to content
Advertisement

Tag: mysql

Can’t insert Cyrillic symbols into MySQL with JDBC

I have a web app which uses com.mysql.jdbc.Driver to connect to MySQL database. Here are jdbcMySQL.properties: I create database like this: And the problem is: if I make then I have in my table BUT, if I make: I have in my table: Answer MySQL is a bit crazy w.r.t. encodings, try: Furthermore there is one more possible error cause:

Find records which cross-reference each other

I want to extract all the rows from a database table, where the rows cross-reference each other. My table contains 2 rows: ref1 & ref2 Table example: In this case, I want my query to return only rows 01 and 03, because they cross-reference each other. Is this possible using a single query, or will I need to iterate the

Calculate price of rental period

I am working on a project for which I need to calculate prices of holiday homes available in a selected rental period. I need some help with building a SQL query that combines the following tables and …

Counting related rows in a child table

I have been trying to do some queries and getting a count on related tables using eloquent. Tables: requests contact (belongs to requests) history (belongs to contact) As such X number of requests each have Y number of contacts which in term each have Z number of histories Using sql I can do something like this to get all the

Advertisement