Skip to main content

Questions tagged [case]

-1 votes
1 answer
95 views

Problem I am well aware that SQL is a declarative language and does not enforce short-circuiting. Oracle, on the other hand, explicitly states that short-circuiting takes place for CASE statements. I ...
Pruzo's user avatar
  • 3
0 votes
1 answer
152 views

I have a query which has multiple joins and need case statements for multiple columns to get the correct data. Although I can manage to get the data, it creates a lot of duplicate rows. Seems like 1 ...
Gibbs Khan's user avatar
1 vote
1 answer
678 views

I am trying to write a regex that can replace '[', ']' and '].' with '_' and in cases where ']' is the last character it should be replaced with '' but I am struggling to come up with a regex for it ...
Pepe Silvia's user avatar
0 votes
0 answers
30 views

Does anyone know the file name or path where I can change the lower_case_tables_names value on the latest version of MySQL Windows 11?
Tubatse Katlego Moloi's user avatar
0 votes
2 answers
898 views

I have 2 tables, size and cost. My query does a count with a greater than comparison of cost and counts different sizes. table1: size u table2: cred t Here is my query: select u.size as size ,...
tkmagnet's user avatar
-1 votes
1 answer
69 views

When I use my query to select all data from the table I have a problem with the custnumber field. If custnumber is returned within the same month then it should group the results but only then. This ...
James's user avatar
  • 1
0 votes
1 answer
167 views

Say I have below table cis aid cid apid ntime buid flg jid 30 1208 229067737 1026 9 DDDD400C 0 0 30 1209 229067737 1026 11 DDDD400C 0 0 30 0 229067737 1026 12 DDDD400C 1 100 30 1210 229067737 1026 13 ...
Himanshuman's user avatar
2 votes
1 answer
133 views

I have two tables: EVENTS ID Name 1 First event 2 Second event 3 Third event 4 Fourth event 5 Fifth event EVENTS_META ID EventID MetaKey MetaValue 1 2 date_expired 2023-02-09 00:00:00 2 2 date_expired ...
Martin J's user avatar
0 votes
2 answers
213 views

SQL Case When - I have a column with job status options B & D. I want to create a case when SQL statement that will check and retrieve employee IDs with both statuses in the column. In thise case ...
jones0207's user avatar
1 vote
1 answer
368 views

I have the following case statement case %1$s::text when ''lookup_relation_job'' then case %1$s.relation when ''followers'' then ''get-followers'' when ''following'' then ''get-...
Sumit Ghosh's user avatar
0 votes
0 answers
490 views

I have part of a string that I would like to remove when selecting. The Problem is that there are a few pieces within the string that changes. This is what I have so far. Select GROUP_CONCAT(...
Joey Freeman's user avatar
0 votes
1 answer
1k views

I am trying to return multiple columns only if a condition matches, else, return something else. Using Sqlite3, my understanding is that the way to do this is using CASE, so something like this: ...
Josh Brower's user avatar
0 votes
2 answers
193 views

I'm trying to write a case expression where it looks at the due date and if it has passed chooses the upcoming or closest due date. Now due to certain database restriction I have to do this manually. ...
NasahT's user avatar
  • 25
-1 votes
2 answers
3k views

I need some logic help with a complex join situation. Here is an overall idea of the 3 tables I am working with Table 1: ID Number Type 1 A1 A2 Table 2: ID Number Type 1 ID Number Type 2 A1 B1 A1 B2 ...
nicole33789's user avatar
1 vote
1 answer
2k views

I have four tables like this: company: id companyContactID customerID companyTeamID 1 12 21 54 2 14 12 78 document_associated_company: id companyID documentID 1 2 98 2 1 12 document id documentTypeID ...
THpubs's user avatar
  • 163

15 30 50 per page
1
2 3 4 5
13