[Solved] Oracle NOT pl/sql [closed]

I think you want this: select * from inside_sales where x = ‘equipment’ union all select * from outside_sales where x <> ‘equipment’; Note: The second condition is slightly more complicated if x can be NULL. 1 solved Oracle NOT pl/sql [closed]

[Solved] join in table for multiple column [closed]

As you have three different foreign keys, you need to do 3 different joins with the same table: SELECT table1.name AS ‘id_name’, first.name AS ‘id1_name’, second.name AS ‘id2_name’ FROM table2 JOIN table1 ON table1.id = table2.id JOIN table1 first ON first.id = table2.id1 JOIN table1 second ON second.id = table2.id2 2 solved join in table … Read more

[Solved] How to select data from the following table?

select category_name,parent_category_name from tbl_product p left join ( select cp.category_code, case when cp.parent_code = 0 then ” when cp.parent_code != 0 then cp.category_name end as category_name, cp.parent_code, isnull(ch.category_name, cp.category_name) as parent_category_name from tbl_category cp left join ( select cl.category_name, cl.category_code, cl.parent_code from tbl_category cl ) ch on cp.parent_code = ch.category_code ) as cat on cat.category_code … Read more

[Solved] Php Filter array

array_filter : The official documentation for PHP is full of very understandable examples for each function. These examples are given by the documentation or the community, and follows each function description. PHP Documentation Form validation : A little code example for the script called by your POST form. Of course a lot of changes to … Read more

[Solved] MYSQL error Unknown column in ‘having clause’

finally I found the solution, rename the variable date and change it in the sentence having. SELECT creditos.NombreCliente, creditos.Contrato, creditos.Rut, creditos.lIdtplCabezaCotiza, creditos.FechaPagare, creditos.FechaCurse, creditos.FechaVcto1, creditos.FechaVcto2, creditos.FormaPago, creditos.EstadoMandato, REPLACE (CuentaCorriente, ‘,’, ‘.’) AS CuentaCorriente, creditos.Sucursal, creditos.cFyI, creditos.FechaUltimoPago, estado_creditos_banco.`Fecha ActivaciĆ³n` AS FechaActivacion, estado_creditos_banco.`Detalle de Rechazo` AS DetalleRechazo, MAX( estado_creditos_banco.`Fecha RecepciĆ³n CCA` ) as fecha, estado_activos_banco.Observaciones, estado_creditos_banco.`Estado General` … Read more

[Solved] SQL INSERT VALUES INTO TABLE FROM FILE [closed]

Both your PHP and your MySQL syntax have problems. First, your SQL statement needs to be surrounded by quotes. Secondly, the syntax for LOAD DATA INFILE is incorrect. Try this: $stmt=$db->prepare(“LOAD DATA INFILE ‘insert.txt’ into table `Info`”); $stmt->execute(); See the MySQL docs for LOAD DATA INFILE for more options. You’ll probably need to specify your … Read more

[Solved] Identifying Unique Visits by Customer [closed]

You can use row_number() and conditional aggregation. Here is an exaple: select customerid, avg(sales) as avgsales, max(case when segnum = 1 then sales end) as sales_01, max(case when segnum = 2 then sales end) as sales_02, max(case when segnum = 3 then sales end) as sales_03 from (select t.*, row_number() over (partition by customerid order … Read more

[Solved] INSERT INTO syntax error in c#

This should work: OleDbCommand cmd = new OleDbCommand(@”INSERT INTO tbbill(invoice,[datetime],custm,total,tax,grand) VALUES(” + Convert.ToInt32(txtinvoice.Text) + “,\”” + dateTimePicker1.Value.ToString(“yyyy/MMM/dd”) + “\”,\”” + Convert.ToString(txtcn.Text) + “\”,\”” + txtttl.Text + “\”,\”” + Convert.ToInt32(cmtax.Text) + “\”,\”” + txtgrdttl.Text + “\”)”, con); cmd.CommandType = CommandType.Text; cmd.ExecuteNonQuery(); con.Close(); EDIT: As stated by others, your query is still open to SQL injection. Dmitry’s … Read more

[Solved] SQL – Insert 1000 values fast [closed]

I don’t know what data base are you using. You can search for “Bulk Insert” for your data base, it allows you to insert complete file in one step. If you need to create an instruction like this: INSERT CodesTable VALUES (91111), (91112), … (91999) You could open/copy&past the file in query editor. Make a … Read more

[Solved] Show Date as dddd Mmmm d, yyyy SQL

Use the following with DateName and convert functions : select DateName( month , q.dt )+’ ‘+convert(char,day(q.dt))+’, ‘+convert(char,year(q.dt)) from ( select convert(date,’20180802′) as dt ) q; SQL Fiddle Demo With respect to your last comment make your query as : select DateName( weekday , q.dt )+’ ‘+ DateName( month , q.dt )+’ ‘+ convert(char,day(q.dt))+’, ‘+convert(char,year(q.dt)) as … Read more