I have a query that returns a row of multiple Itemcodes. The result is Date group list of item code 2015-04-15 118 FYCT-00063,FYCM-00016,FYCM-00064,FYCF-00018 it’s working …
Why does Hibernate generate a CROSS JOIN for an implicit join of a @ManyToOne association?
Baur & King said in their book: Implicit joins are always directed along many-to-one or one-to-one association, never through a collection-valued association. [P 646, Ch 14] But when I am doing that in the code it is generating a CROSS JOIN instead of an INNER JOIN. Mapping is from Member2 (many-to-one) -…
How to unify three different queries in mysql when exists multiple criteria?
I have a table and I need to get the number of rows using different criteria. Currently I use 3 queries one after another: SELECT COUNT(status) FROM projects WHERE project=’1′ SELECT COUNT(status) FROM projects WHERE project=’1′ AND status>’10’ SELECT COUNT(status) FROM …
How to insert multiple rows from a single query using eloquent/fluent
I have the following query: and as expected I get the following result: Is there a way of copying the above result into another table so that my table looks like this? The problem I have is that the $query can expect any number of rows and so im unsure how to iterate through an unknown number of rows. Answer
how to show decimals in sql instead of 0
I am trying to get the percent and it just shows up as zero. I want to show two decimal places such as 0.65 Here is a piece of the query I am selecting: if I use this it shows up as 0 and gets rid of the rest Answer Meanwhile, I question whether COUNT(numbers) is what you want. That
MySQL order by field in Eloquent
When I want to define a custom sort order in a MySQL query I can do something like this: ORDER BY FIELD(language,’USD’,’EUR’,’JPN’) What would be the Eloquent ORM version of that? UPDATE: This is …
PHP Dropdown Box from SQL Join
I want to do is have a dropdown box that will display the MealOption and when that is selected somehow find that products meal id? This is my database layout
Columns with keywords as names in PostgreSQL
I have a couple of tables which have keywords as column names. I am not able to write a subquery using them. Even if I use non-existing column names, the query works. For example I have a few questions – when I use a non-existing column name in a subquery, it works. But if I use the same column name
PHP executes but doesnt execute SQL update correctly
I have a table which displays -Staff ID (Primary Key) -Staff Name -Staff Position All the data loads in to my grid, the grid has an update button witch should let me to update it but it returns …
How to find consecutive values in column
I have been given this task to try to detect some duplicate records in a table with a large volume of rows. The table comprises 2 joined tables. So to begin with I have: select b.event_number_id, b….