Skip to content
Advertisement

Tag: select

SQL Informix advanced query

Let me try to explain what I want to do with my data. Structure of my data is as follows: I have 3 columns: date, id, and stage. Stages can be different numbers, but I’m interested in showing specific transition of some id from stage -1 to stage 1. Please see the example below. I have an id that was

Query to obtain value among selected values in a comma separated varchar

I have an SQL table as given below How can I write a Select query such that all titles with genre “Crime” will be displayed Answer First, you should fix your data model! Storing multiple values in a column is a really, really, really bad idea. That said, sometimes we are stuck with other people’s really, really, really bad decisions.

Get TOP 1 row from multiple tables based on date

I have five tables in a SQL Server database. These tables are listed below and I want to select Data from these tables according to date. I tried searching but could not find solution for multiple tables. Please help TABLE1 TABLE2 TABLE3 TABLE4 TABLE5 I want to select Label and Date from Table 3, 4 and 5 where Date is

Query to check if MySQL database is connected

I am wondering if there is a best practice or standard query used to check if a MySQL database is still connected? I was originally thinking of performing a simple search in one of my tables, which will confirm if the database is still there. Just wondering if there is a better approach. Answer No need to actually select from

Advertisement