Tagged Questions
0
votes
0answers
27 views
SQL- Selecting Columns based on Date and Batch Number
I am using Chartrunner Lean to produce graphs based on Batch number and Run Date. In the data base there are multiple columns. There are two different sides of the plant which produce data and they ...
0
votes
1answer
14 views
Laravel Eloquent Select CASE?
Is there anyone with experience in PHP & Laravel Eloquent who can help me resolve this statement? I'm trying to inject a CASE... WHEN.. END... inside a raw() method. It seemed like it was ...
0
votes
1answer
27 views
Difficult SELECT statement with only two columns
I have an SQL Server table structured as follows :
Table name : calendar.
Columns :
Calendar Date (smalldatetime)
Working Day (bit)
Calendar date has all dates, structured in the format ...
4
votes
2answers
37 views
MySQL select based on ENUM values
I have a a suppliers directory table in a MySQL database which has an associated suppliers mappings table. This table maps the following criteria against an individual supplier:
Services.
...
0
votes
2answers
31 views
Can't retrieve DB info
I need help figuring out why the following DB Query is not working. I know the DB connection is good. I also know the $referralname = $_SESSION['user_name']; is correctly rendering. It has to be ...
1
vote
1answer
25 views
MySQL - Selecting rows that do not have a match or that have with a condition
I can't figure this out so far, I have these tables:
students - Columns: id, name
stud_class - Columns: students_id, class_id
class - Columns: id, courses_id
courses - Columns: id, name
I need ...
1
vote
0answers
29 views
Is it possible to replace a value used in an SQL Query with a IN (SELECT…) that returns that same value?
The following QUERY #1 returns the correct results when value "1010" is used:
SELECT *
FROM iterations $iterations2, experiments $experiments1, clients $clients1
WHERE $experiments1.id = ...
-7
votes
1answer
38 views
sql select more values [closed]
In this code I need to add one more option: if field_id 21 = 24
SELECT
v.*, i.title
FROM
gavwb_flexicontent_fields_item_relations AS v
JOIN
gavwb_content AS i ON ...
1
vote
3answers
50 views
How to fetch a row which is related to multiple rows in another table?
I have some tables:
ws_shop_product
CREATE TABLE `ws_shop_product` (
`product_id` int(10) unsigned NOT NULL AUTO_INCREMENT
`product_title` varchar(255) COLLATE utf8_general_ci DEFAULT ...
-1
votes
1answer
33 views
Build a field in the Select Q
I am trying to add a field in my Select statment that will create a field with my desired output or make the field results empty. My Boss doesn't want to scan the entire mopdescription field if they ...
0
votes
2answers
45 views
Pivot on joined tables SQL Server
I have two tables with data
TAB1
---------------------------------------------
| ID1 | ID2 | SIGNEDBY | A | B | C |
| 1 | 8 | 'aa' |'John' | 9 | 12/12 |
| 2 | 9 ...
1
vote
2answers
32 views
SQL insert row with one change
I have this table:
Table1:
id text
1 lala
And i want take first row and copy it, but the id 1 change to 2.
Can you help me with this problem?
0
votes
3answers
137 views
Mysql date function not working for less than
I need to get all records those equal and less than 2012-12-28 i used bellow query for this,
booking_time is DATETIME field, and there are records less than 2012-12-28 but it returns zero rows.
does ...
7
votes
9answers
4k views
SQL SELECT INSERT INTO Generate Unique Id
I'm attempting to select a table of data and insert this data into another file with similar column names (it's essentially duplicate data). Current syntax as follows:
INSERT INTO TABLE1 (id, id2, ...
5
votes
4answers
7k views
Select multiple counts from one database table in one sql command
I have a Oracle database table like so, which records an item being scanned at a scanning point.
ItemsScan
ItemScanId
ItemScanPoint
ItemType
ScanTime
I want to return the ItemScanPoint ...